diff --git a/application/agents/tools/tool_action_parser.py b/application/agents/tools/tool_action_parser.py index 4d894d1a..c7da5a4c 100644 --- a/application/agents/tools/tool_action_parser.py +++ b/application/agents/tools/tool_action_parser.py @@ -1,4 +1,7 @@ import json +import logging + +logger = logging.getLogger(__name__) class ToolActionParser: @@ -20,6 +23,7 @@ class ToolActionParser: tool_id = call["function"]["name"].split("_")[-1] action_name = call["function"]["name"].rsplit("_", 1)[0] except (KeyError, TypeError) as e: + logger.error(f"Error parsing OpenAI LLM call: {e}") return None, None, None else: try: @@ -27,6 +31,7 @@ class ToolActionParser: tool_id = call.function.name.split("_")[-1] action_name = call.function.name.rsplit("_", 1)[0] except (AttributeError, TypeError) as e: + logger.error(f"Error parsing OpenAI LLM call: {e}") return None, None, None return tool_id, action_name, call_args