mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-08 22:21:35 +00:00
fix: guard code_interpreter conversion to bash_code_execution results only
Skip non-bash tool result types (e.g. text_editor_code_execution_tool_result) to avoid producing empty code_interpreter_call items in Responses API output.
This commit is contained in:
parent
3962fbc33a
commit
8f60117228
2 changed files with 4 additions and 0 deletions
|
|
@ -703,6 +703,8 @@ class ModelResponseIterator:
|
|||
"""
|
||||
results = []
|
||||
for tr in self.tool_results:
|
||||
if tr.get("type") != "bash_code_execution_tool_result":
|
||||
continue
|
||||
call_id = tr.get("tool_use_id", "")
|
||||
content = tr.get("content", {})
|
||||
if isinstance(content, dict):
|
||||
|
|
|
|||
|
|
@ -1767,6 +1767,8 @@ class AnthropicConfig(AnthropicModelInfo, BaseConfig):
|
|||
pass
|
||||
code_interpreter_results = []
|
||||
for tr in tool_results:
|
||||
if tr.get("type") != "bash_code_execution_tool_result":
|
||||
continue
|
||||
call_id = tr.get("tool_use_id", "")
|
||||
content = tr.get("content", {})
|
||||
if isinstance(content, dict):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue