mirror of
https://github.com/tiennm99/litellm.git
synced 2026-08-14 18:23:13 +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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user