Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- import json
- from watson_developer_cloud import ConversationV1
- conversation = ConversationV1(
- username='b6ddccfd-c4c0-4e20-a239-0ff76ee51461',
- password='S1iYFCciJ2q7',
- version='2017-05-26'
- )
- # Replace with the context obtained from the initial request
- context = {
- 'name': 'Tomas',
- 'concepts': '83603693',
- #'conversation_id': '453b92e4-f0c6-42e7-8fe4-b3bc7b7e7052',
- 'amount': '300.000'
- }
- workspace_id = 'f2ffb6d2-391b-4f23-9a8b-be9e1153e5c0'
- response = conversation.message(
- workspace_id=workspace_id,
- message_input=None,
- context=context
- )
- #print(json.dumps(response, indent=2))
- print response['output']['text']
- while True:
- text_input = raw_input('SAY: ')
- response = conversation.message(
- workspace_id=workspace_id,
- message_input={'text': text_input},
- context=context
- )
- #print(json.dumps(response, indent=2))
- print response['output']['text']
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement