mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-23 05:34:41 +00:00
fix(anthropic): type tool_result block for is_error lookup
Removes the reportUnknownMemberType added by content.get("is_error") on
the untyped client payload; same cast-ok pattern as _tool_result_part.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
289b1b5df0
commit
ee24e7bd8f
1 changed files with 2 additions and 1 deletions
|
|
@ -535,7 +535,8 @@ class LiteLLMAnthropicMessagesAdapter:
|
|||
content=self._tool_result_content(content.get("content")),
|
||||
)
|
||||
self._add_cache_control_if_applicable(content, tool_result, model)
|
||||
if content.get("is_error") is True and self.target_consumes_tool_error(
|
||||
tool_result_block = cast(Mapping[str, object], content) # cast-ok: untrusted client payload
|
||||
if tool_result_block.get("is_error") is True and self.target_consumes_tool_error(
|
||||
model, custom_llm_provider
|
||||
):
|
||||
tool_result["is_error"] = True
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue