infra: bump anthropic mypy 1 (#22373)

This commit is contained in:
Bagatur
2024-06-03 08:21:55 -07:00
committed by GitHub
parent ceb73ad06f
commit 678a19a5f7
8 changed files with 120 additions and 124 deletions

View File

@@ -104,7 +104,7 @@ def _merge_messages(
curr = curr.copy(deep=True)
if isinstance(curr, ToolMessage):
if isinstance(curr.content, str):
curr = HumanMessage(
curr = HumanMessage( # type: ignore[misc]
[
{
"type": "tool_result",
@@ -114,7 +114,7 @@ def _merge_messages(
]
)
else:
curr = HumanMessage(curr.content)
curr = HumanMessage(curr.content) # type: ignore[misc]
last = merged[-1] if merged else None
if isinstance(last, HumanMessage) and isinstance(curr, HumanMessage):
if isinstance(last.content, str):
@@ -425,7 +425,7 @@ class ChatAnthropic(BaseChatModel):
]
message_chunk = AIMessageChunk(
content=message.content,
tool_call_chunks=tool_call_chunks,
tool_call_chunks=tool_call_chunks, # type: ignore[arg-type]
)
yield ChatGenerationChunk(message=message_chunk)
else:
@@ -464,7 +464,7 @@ class ChatAnthropic(BaseChatModel):
]
message_chunk = AIMessageChunk(
content=message.content,
tool_call_chunks=tool_call_chunks,
tool_call_chunks=tool_call_chunks, # type: ignore[arg-type]
)
yield ChatGenerationChunk(message=message_chunk)
else: