def response(text, BOT, debugMode, reset, recent, name): if (debugMode == "trace" and reset == 'reset' and recent == 'recent'): fullresponse = API.debug_bot(USER_KEY, APP_ID, HOST, BOT, text, session_id=True, reset=True, trace=True, recent=True) print "Bot Response: ", fullresponse elif (debugMode == "trace" and reset == 'none'): fullresponse = API.debug_bot(USER_KEY, APP_ID, HOST, BOT, text, trace=True) print "Bot Response: ", fullresponse else: fullresponse = API.talk(USER_KEY, APP_ID, HOST, BOT, text, clientID=name) bot_response = fullresponse['response'] session_id = fullresponse['sessionid'] print BOT + " says: \" ", bot_response, " \" " print "Session ID: " + str(session_id)
def reset(): API.debug_bot(user_key, app_id, host, botname, input_text, session_id, reset=True, recent=True)
def resetBot(BOT): result = API.debug_bot(USER_KEY, APP_ID, HOST, BOT, "generic", reset=True) print result