Beispiel #1
0
def continue_conversation(message):
    history = request.get_json()
    state = State(DICTIONARY_PATH)

    if history:
        state.history = history

    state.eat(message.lower())
    return json.dumps(state.history)
Beispiel #2
0
def talk(api: str, state: State, message: str):
    url = f'{api}/agent/{message}'
    req = requests.post(url)
    state.history = create_pairs(req.json())
    return state.history[-1]