From d9715ad7979750a58f681be4aab39a156d38e2a3 Mon Sep 17 00:00:00 2001 From: Chester Curme Date: Thu, 8 May 2025 13:03:19 -0400 Subject: [PATCH] x --- .../tests/integration_tests/test_chat_models.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) 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 caab0ae3202..a2c49946ea7 100644 --- a/libs/partners/anthropic/tests/integration_tests/test_chat_models.py +++ b/libs/partners/anthropic/tests/integration_tests/test_chat_models.py @@ -37,13 +37,18 @@ async def test_astream() -> None: pass -async def test_stream_usage() -> None: - model = ChatAnthropic(model_name=MODEL_NAME) # type: ignore[call-arg] - async for token in model.astream("hi"): - assert isinstance(token, AIMessageChunk) +# async def test_stream_usage() -> None: +# model = ChatAnthropic(model_name=MODEL_NAME, stream_usage=False) # type: ignore[call-arg] +# async for token in model.astream("hi"): +# assert isinstance(token, AIMessageChunk) +# assert token.usage_metadata is None - async for token in model.astream("hi"): - assert isinstance(token, AIMessageChunk) +# # check we override with kwarg +# 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_async_stream_twice() -> None: