Advertisement
Guest User

Untitled

a guest
Aug 31st, 2016
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. import json
  2. from watson_developer_cloud import ConversationV1
  3.  
  4. conversation = ConversationV1(
  5. username='SERVICE_USERNAME',
  6. password='SERVICE_PASSWORD',
  7. version='2016-07-11')
  8.  
  9. workspace_id = 'WORKSPACE_ID_CONVERSATION'
  10.  
  11. response = conversation.message(workspace_id=workspace_id, context= {'username':'Simon'})
  12.  
  13. print json.dumps(response)
  14.  
  15. {
  16. "entities":[],
  17. "intents":[],
  18. "output":{
  19. "log_messages":[],
  20. "nodes_visited":["node_1_1472298724972],
  21. "text":["Hello Simon"]
  22. },
  23. "context":{
  24. "username":"Simon",
  25. "conversation_id":"9dc1501b-ac53-4b51-a299-37f5314ebf89",
  26. "system":{
  27. "dialog_turn_counter":1,
  28. "dialog_stack":["root"],
  29. "dialog_request_counter":1
  30. }
  31. },
  32. "input":{}
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement