mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-06-09 08:21:50 +00:00
docs: update docstring to mention Fireworks strict validation
Updates _sanitize_tool_calls_for_strict_api docstring to explicitly mention Fireworks alongside Mistral as strict APIs requiring sanitization. Also documents the specific fields that are stripped (call_id, response_item_id).
This commit is contained in:
parent
8545343cba
commit
ed4a605696
1 changed files with 7 additions and 4 deletions
11
run_agent.py
11
run_agent.py
|
|
@ -5324,15 +5324,18 @@ class AIAgent:
|
|||
def _sanitize_tool_calls_for_strict_api(api_msg: dict) -> dict:
|
||||
"""Strip Codex Responses API fields from tool_calls for strict providers.
|
||||
|
||||
Providers like Mistral strictly validate the Chat Completions schema
|
||||
and reject unknown fields (call_id, response_item_id) with 422.
|
||||
These fields are preserved in the internal message history — this
|
||||
method only modifies the outgoing API copy.
|
||||
Providers like Mistral, Fireworks, and other strict OpenAI-compatible APIs
|
||||
validate the Chat Completions schema and reject unknown fields (call_id,
|
||||
response_item_id) with 400 or 422 errors. These fields are preserved in
|
||||
the internal message history — this method only modifies the outgoing
|
||||
API copy.
|
||||
|
||||
Creates new tool_call dicts rather than mutating in-place, so the
|
||||
original messages list retains call_id/response_item_id for Codex
|
||||
Responses API compatibility (e.g. if the session falls back to a
|
||||
Codex provider later).
|
||||
|
||||
Fields stripped: call_id, response_item_id
|
||||
"""
|
||||
tool_calls = api_msg.get("tool_calls")
|
||||
if not isinstance(tool_calls, list):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue