mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-25 05:54:53 +00:00
fix(anthropic): drop list annotation in thought-signature id parse
LIT001 ceiling was one over merge-base because Final[list[str]] on the split of tool_call.id. Use str.partition instead so the signature path adds no mutable collection annotation.
This commit is contained in:
parent
ba77ca902b
commit
56ff4548e2
1 changed files with 3 additions and 3 deletions
|
|
@ -386,9 +386,9 @@ class LiteLLMAnthropicMessagesAdapter:
|
|||
|
||||
raw_id: Final[object] = _optional_attr(tool_call, "id")
|
||||
if isinstance(raw_id, str) and THOUGHT_SIGNATURE_SEPARATOR in raw_id:
|
||||
parts: Final[list[str]] = raw_id.split(THOUGHT_SIGNATURE_SEPARATOR, 1)
|
||||
if len(parts) == 2 and parts[1]:
|
||||
return parts[1]
|
||||
_, _, embedded = raw_id.partition(THOUGHT_SIGNATURE_SEPARATOR)
|
||||
if embedded:
|
||||
return embedded
|
||||
|
||||
return None
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue