From 50ce3bf5d94c89e46bd2150d60c020caa5d81725 Mon Sep 17 00:00:00 2001 From: Chester Curme Date: Thu, 8 May 2025 10:45:55 -0400 Subject: [PATCH] x --- .../anthropic/tests/integration_tests/test_chat_models.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libs/partners/anthropic/tests/integration_tests/test_chat_models.py b/libs/partners/anthropic/tests/integration_tests/test_chat_models.py index 8b64c1f940e..3debbad3fe5 100644 --- a/libs/partners/anthropic/tests/integration_tests/test_chat_models.py +++ b/libs/partners/anthropic/tests/integration_tests/test_chat_models.py @@ -149,10 +149,13 @@ async def test_async_stream_twice() -> None: model = ChatAnthropic(model_name=MODEL_NAME, stream_usage=False) async for token in model.astream("hi"): assert isinstance(token, AIMessageChunk) + assert token.usage_metadata is None model = ChatAnthropic(model_name=MODEL_NAME) # type: ignore[call-arg] + assert model.stream_usage async for token in model.astream("hi", stream_usage=False): assert isinstance(token, AIMessageChunk) + assert token.usage_metadata is None async def test_abatch() -> None: