From 035252c1463386898acd00d29d86970ac0db98bf Mon Sep 17 00:00:00 2001 From: Showdown76py Date: Mon, 19 May 2025 13:21:15 +0200 Subject: [PATCH] fix: Enhance logging for tool calls in process method; handle potential errors in next steps assignment --- ai/processor.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ai/processor.py b/ai/processor.py index 6a398d9..ecfcf79 100644 --- a/ai/processor.py +++ b/ai/processor.py @@ -57,9 +57,18 @@ class AIProcessor: tool_calls = getattr(response.choices[0].message, "tool_calls", None) if tool_calls: for tc in tool_calls: + logger.debug( + "Processing tool call: %s with arguments: %s", + tc.function.name, + tc.function.arguments, + ) if tc.function.name == "confirm": reexec = False - nextsteps = tc.function.arguments.get("goal", "") + try: + nextsteps = tc.function.arguments.get("goal", "") + except: + nextsteps = str(tc.function.arguments) + print('ERROR NEXT STEPS IS STR, ', nextsteps) r = ai.compute._execute( name=tc.function.name, args=json.loads(tc.function.arguments),