anthropic[patch]: split test into two (#31167)

This commit is contained in:
ccurme
2025-05-08 09:23:36 -04:00
committed by GitHub
parent d4555ac924
commit 2d202f9762

View File

@@ -134,6 +134,9 @@ async def test_stream_usage() -> None:
async for token in model.astream("hi"):
assert isinstance(token, AIMessageChunk)
assert token.usage_metadata is None
async def test_stream_usage_override() -> None:
# check we override with kwarg
model = ChatAnthropic(model_name=MODEL_NAME) # type: ignore[call-arg]
assert model.stream_usage