fix to ai_client.py

This commit is contained in:
2026-02-22 17:19:15 -05:00
parent 73fad80257
commit 8a3c2d8e21
4 changed files with 71 additions and 37 deletions

View File

@@ -955,13 +955,16 @@ def _send_anthropic(md_content: str, user_message: str, base_dir: str, file_item
),
})
def _strip_private_keys(history):
return [{k: v for k, v in m.items() if not k.startswith("_")} for m in history]
response = _anthropic_client.messages.create(
model=_model,
max_tokens=_max_tokens,
temperature=_temperature,
system=system_blocks,
tools=_get_anthropic_tools(),
messages=_anthropic_history,
messages=_strip_private_keys(_anthropic_history),
)
# Convert SDK content block objects to plain dicts before storing in history