fix to ai_client.py
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user