From 395008456e5de2b4a21315cc4ab50bc4f6caa2ac Mon Sep 17 00:00:00 2001 From: Chester Curme Date: Thu, 8 May 2025 13:05:28 -0400 Subject: [PATCH] x --- .../integration_tests/test_chat_models.py | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 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 a2c49946ea7..7e733da8764 100644 --- a/libs/partners/anthropic/tests/integration_tests/test_chat_models.py +++ b/libs/partners/anthropic/tests/integration_tests/test_chat_models.py @@ -9,12 +9,12 @@ from langchain_anthropic import ChatAnthropic, ChatAnthropicMessages MODEL_NAME = "claude-3-5-haiku-latest" -def test_stream() -> None: - """Test streaming tokens from Anthropic.""" - llm = ChatAnthropicMessages(model_name=MODEL_NAME) # type: ignore[call-arg, call-arg] +# def test_stream() -> None: +# """Test streaming tokens from Anthropic.""" +# llm = ChatAnthropicMessages(model_name=MODEL_NAME) # type: ignore[call-arg, call-arg] - for token in llm.stream("I'm Pickle Rick"): - pass +# for token in llm.stream("I'm Pickle Rick"): +# pass async def test_astream() -> None: @@ -37,18 +37,18 @@ async def test_astream() -> None: pass -# 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 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 -# # 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 + # 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: