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):
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

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