bug fix chat history in ai

This commit is contained in:
2023-07-31 12:18:10 -03:00
parent b4b28110b1
commit ef34961222
3 changed files with 15 additions and 7 deletions
+7 -3
View File
@@ -2379,9 +2379,13 @@ Categorize the user's request based on the operation they want to perform on
def _process_input(self, input, history):
response = self.myai.ask(input , chat_history = history, dryrun = True)
if not response["app_related"]:
if not history:
history = []
history.extend(response["chat_history"])
try:
if not history:
history = []
history.extend(response["chat_history"])
except:
if not history:
history = None
return response["response"], history
else:
history = None