daily pastebin goal
93%
SHARE
TWEET

Untitled

a guest Jan 13th, 2018 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import json
  2. from watson_developer_cloud import ConversationV1
  3.  
  4. conversation = ConversationV1(
  5.   username = '{username}',
  6.   password = '{password}',
  7.   version = '2017-05-26'
  8. )
  9.  
  10. # parent workspace id
  11. workspace_id = ''
  12.  
  13. # text
  14. text = 'what is my credit score' # or whatever fits your use case
  15.  
  16. # send to router
  17. response = conversation.message(
  18.     workspace_id=workspace_id,
  19.     message_input={
  20.         'text': text
  21.     }
  22. )
  23.  
  24. print(json.dumps(response, indent=2))
RAW Paste Data
Top