def call_api(client_id,conversation_id,message): param = {'client_id': client_id, 'conversation_id':conversation_id, 'input':message} resp = dialog_rest.post_request('conversation',param) try: response = resp['response'][0]+resp['response'][1] except: response = resp['response'][0] return resp['client_id'], resp['conversation_id'] ,response
import dialog_rest conversation_id = "" client_id = "" message="hi" param = {'client_id': client_id, 'conversation_id':conversation_id, 'input':message} res = dialog_rest.post_request('conversation',param) print(res['response']) print(res['client_id']) print(res['conversation_id']) print('---------------------') conversation_id = res['conversation_id'] client_id = res['client_id'] message="which" param = {'client_id': client_id, 'conversation_id':conversation_id, 'input':message} res = dialog_rest.post_request('conversation',param) print(res['response']) print(res['client_id']) print(res['conversation_id']) print('---------------------') conversation_id = res['conversation_id'] client_id = res['client_id'] message="Beta, Alpha, Standard Deviation, Sharpe Ratio" param = {'client_id': client_id, 'conversation_id':conversation_id, 'input':message}