diff --git a/ai/processor.py b/ai/processor.py index c454063..0412144 100644 --- a/ai/processor.py +++ b/ai/processor.py @@ -58,6 +58,7 @@ class AIProcessor: tool_calls = getattr(response.choices[0].message, "tool_calls", None) if tool_calls: for tc in tool_calls: + ags = json.loads(tc.function.arguments) logger.debug( "Processing tool call: %s with arguments: %s", tc.function.name, @@ -66,15 +67,15 @@ class AIProcessor: if tc.function.name == "confirm": reexec = False try: - nextsteps = tc.function.arguments.get("goal", "") + nextsteps = ags.get("goal", "") except: nextsteps = str(tc.function.arguments) print('ERROR NEXT STEPS IS STR, ', nextsteps) if tc.function.name == "click_button": # extract click position for screenshot crosshair click_positions.extend(tuple( # button_type, x, y - map(int,(tc.function.arguments.get("x", 0), - tc.function.arguments.get("y", 0) + map(int,(ags.get("x", 0), + ags.get("y", 0) ) ) ))