bug fix chat history in ai

This commit is contained in:
fluzzi 2023-07-31 12:18:10 -03:00
parent 54fa5845af
commit be40b2accd
3 changed files with 15 additions and 7 deletions

View File

@ -1,2 +1,2 @@
__version__ = "3.3.0" __version__ = "3.3.1"

View File

@ -598,9 +598,13 @@ class connapp:
def _process_input(self, input, history): def _process_input(self, input, history):
response = self.myai.ask(input , chat_history = history, dryrun = True) response = self.myai.ask(input , chat_history = history, dryrun = True)
if not response["app_related"]: if not response["app_related"]:
try:
if not history: if not history:
history = [] history = []
history.extend(response["chat_history"]) history.extend(response["chat_history"])
except:
if not history:
history = None
return response["response"], history return response["response"], history
else: else:
history = None history = None

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): def _process_input(self, input, history):
response = self.myai.ask(input , chat_history = history, dryrun = True) response = self.myai.ask(input , chat_history = history, dryrun = True)
if not response["app_related"]: if not response["app_related"]:
try:
if not history: if not history:
history = [] history = []
history.extend(response["chat_history"]) history.extend(response["chat_history"])
except:
if not history:
history = None
return response["response"], history return response["response"], history
else: else:
history = None history = None