mirror of
https://github.com/agent0ai/agent-zero.git
synced 2026-08-25 08:14:19 +00:00
Merge pull request #1381 from nicolasleao/development
fix: let agents fix their own tool call format instead of erroring
This commit is contained in:
commit
4b9f0ecc23
1 changed files with 4 additions and 2 deletions
6
agent.py
6
agent.py
|
|
@ -848,8 +848,10 @@ class Agent:
|
|||
# search for tool usage requests in agent message
|
||||
tool_request = extract_tools.json_parse_dirty(msg)
|
||||
|
||||
# basic validation + extensions
|
||||
await self.validate_tool_request(tool_request)
|
||||
# Only validate when extraction produced an object; None means no JSON tool
|
||||
# block was found — the misformat warning path below handles that.
|
||||
if tool_request is not None:
|
||||
await self.validate_tool_request(tool_request)
|
||||
|
||||
if tool_request is not None:
|
||||
raw_tool_name = tool_request.get("tool_name", tool_request.get("tool","")) # Get the raw tool name
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue