fix: cast Anthropic-format passthrough message to MessageParam
The fallback path in `_from_universal_context_message` returns `message.message` from an `LLMSpecificMessage`, which is typed loosely (`Any | dict`). The surrounding comment already documents the assumption that the message is already in Anthropic format — make that assumption explicit to pyright with a cast.
This commit is contained in:
@@ -248,7 +248,7 @@ class AnthropicLLMAdapter(BaseLLMAdapter[AnthropicLLMInvocationParams]):
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Fall back to assuming that the message is already in Anthropic format
|
# Fall back to assuming that the message is already in Anthropic format
|
||||||
return copy.deepcopy(message.message)
|
return cast(MessageParam, copy.deepcopy(message.message))
|
||||||
|
|
||||||
def _from_standard_message(self, message: LLMStandardMessage) -> MessageParam:
|
def _from_standard_message(self, message: LLMStandardMessage) -> MessageParam:
|
||||||
"""Convert standard universal context message to Anthropic format.
|
"""Convert standard universal context message to Anthropic format.
|
||||||
|
|||||||
Reference in New Issue
Block a user