Fix tool_calls retrieval to handle None case

This commit is contained in:
ER-EPR 2026-06-01 19:52:33 +08:00 • committed by GitHub
parent 3dcfccb9d8
commit 7d0d075c67
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -422,7 +422,7 @@ def convert_openai_to_anthropic_response(openai_response: dict, model: str = '')
content.append({'type': 'text', 'text': msg_content})
# Tool calls → tool_use blocks
tool_calls = message.get('tool_calls', [])
tool_calls = message.get('tool_calls') or []
for tc in tool_calls:
func = tc.get('function', {})
try: