예제 #1
0
파일: Talk.py 프로젝트: sylvia935/ChatBot
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)
예제 #2
0
def reset():
    API.debug_bot(user_key,
                  app_id,
                  host,
                  botname,
                  input_text,
                  session_id,
                  reset=True,
                  recent=True)
예제 #3
0
def resetBot(BOT):
    result = API.debug_bot(USER_KEY, APP_ID, HOST, BOT, "generic", reset=True)
    print result