fix: ruff check

This commit is contained in:
Alex
2025-03-06 14:31:46 +00:00
parent 49a2b2ce6d
commit d4f53bf6bb

View File

@@ -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