mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-18 14:52:04 +00:00
fix(anthropic): preserve tool use cache markers
This commit is contained in:
parent
a2d6f05d1b
commit
80d71e8d2e
2 changed files with 27 additions and 0 deletions
|
|
@ -1970,6 +1970,11 @@ def _convert_assistant_message(m: Dict[str, Any]) -> Dict[str, Any]:
|
|||
"name": fn.get("name", ""),
|
||||
"input": parsed_args,
|
||||
})
|
||||
if isinstance(m.get("cache_control"), dict):
|
||||
for block in reversed(blocks):
|
||||
if isinstance(block, dict) and block.get("type") in {"text", "tool_use"}:
|
||||
block.setdefault("cache_control", dict(m["cache_control"]))
|
||||
break
|
||||
# Kimi's /coding endpoint (Anthropic protocol) requires assistant
|
||||
# tool-call messages to carry reasoning_content when thinking is
|
||||
# enabled server-side. Preserve it as a thinking block so Kimi
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue