From 881edbad079e1d0d18db84d436746e8afe9d28f7 Mon Sep 17 00:00:00 2001 From: mudler Date: Sat, 5 Aug 2023 11:09:11 +0200 Subject: [PATCH] Add function results to conversation history after we do an action --- main.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 487613a..838d009 100644 --- a/main.py +++ b/main.py @@ -692,7 +692,12 @@ def evaluate(user_input, conversation_history = [],re_evaluate=False, agent_acti if re_evaluation_in_progress: conversation_history.extend(responses) - return conversation_history + return conversation_history + + # unwrap the list of responses + conversation_history.append(responses[-1]) + + #responses = converse(responses) # TODO: this needs to be optimized responses = analyze(responses, prefix=f"You are an AI assistant. Return an appropriate answer to the user input '{user_input}' given the context below and summarizing the actions taken\n")