From 3086579c97f3952e20a34d81ddbe4974fbfe1663 Mon Sep 17 00:00:00 2001 From: Pietro Martino Lugato Date: Mon, 30 Sep 2024 17:47:32 -0400 Subject: [PATCH] hot fix for overly long histories --- A2rchi/interfaces/cleo.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/A2rchi/interfaces/cleo.py b/A2rchi/interfaces/cleo.py index 241887cc..0d1007e6 100644 --- a/A2rchi/interfaces/cleo.py +++ b/A2rchi/interfaces/cleo.py @@ -173,7 +173,11 @@ def process_new_issues(self): if record.notes != "": history += f"\n next entry: {record.notes}" print("History input: ",history) - answer = self.ai_wrapper(self.get_issue_history(issue.id)) + try: + answer = self.ai_wrapper(self.get_issue_history(issue.id)) + except Exception as e: + print(f"ERROR: {e}") + answer = "I am sorry, I am not able to process this request at the moment. Please continue with this ticket manually." self.add_note_to_issue(issue.id,answer) print("A2rchi's response:\n",answer) self.feedback_issue(issue.id)