mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-07 08:26:10 +00:00
fix: non-dict tool result content falls back to outputs=None
Replace str(content) fallback with empty string so non-dict content (e.g. list-shaped text_editor results) produces outputs=None instead of raw Python object representations in logs.
This commit is contained in:
parent
5b3e84f383
commit
3962fbc33a
2 changed files with 2 additions and 2 deletions
|
|
@ -713,7 +713,7 @@ class ModelResponseIterator:
|
|||
parts.append(f"STDERR: {content['stderr']}")
|
||||
logs = "".join(parts)
|
||||
else:
|
||||
logs = str(content)
|
||||
logs = ""
|
||||
tool_input = self._server_tool_inputs.get(call_id, {})
|
||||
code = tool_input.get("command", "") if isinstance(tool_input, dict) else ""
|
||||
log_outputs = (
|
||||
|
|
|
|||
|
|
@ -1777,7 +1777,7 @@ class AnthropicConfig(AnthropicModelInfo, BaseConfig):
|
|||
parts.append(f"STDERR: {content['stderr']}")
|
||||
logs = "".join(parts)
|
||||
else:
|
||||
logs = str(content)
|
||||
logs = ""
|
||||
log_outputs = (
|
||||
[OutputCodeInterpreterCallLog(type="logs", logs=logs)]
|
||||
if logs
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue