From 1fc0d8f3e7032e936d4dd0651fa1cb1b3d8b36e8 Mon Sep 17 00:00:00 2001 From: "David S. Batista" Date: Tue, 4 Mar 2025 12:28:15 +0100 Subject: [PATCH] fixing imports --- .../components/generators/anthropic/chat/chat_generator.py | 2 +- integrations/anthropic/tests/test_chat_generator.py | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/integrations/anthropic/src/haystack_integrations/components/generators/anthropic/chat/chat_generator.py b/integrations/anthropic/src/haystack_integrations/components/generators/anthropic/chat/chat_generator.py index f065fa545..da53d297e 100644 --- a/integrations/anthropic/src/haystack_integrations/components/generators/anthropic/chat/chat_generator.py +++ b/integrations/anthropic/src/haystack_integrations/components/generators/anthropic/chat/chat_generator.py @@ -6,7 +6,7 @@ from haystack.tools import Tool, _check_duplicate_tool_names, deserialize_tools_inplace from haystack.utils import Secret, deserialize_callable, deserialize_secrets_inplace, serialize_callable -from anthropic import Anthropic, AsyncAnthropic, Stream, AsyncStream +from anthropic import Anthropic, AsyncAnthropic, AsyncStream, Stream logger = logging.getLogger(__name__) diff --git a/integrations/anthropic/tests/test_chat_generator.py b/integrations/anthropic/tests/test_chat_generator.py index 39270074f..269e72d0f 100644 --- a/integrations/anthropic/tests/test_chat_generator.py +++ b/integrations/anthropic/tests/test_chat_generator.py @@ -13,9 +13,7 @@ from anthropic.types import ( ContentBlockDeltaEvent, ContentBlockStartEvent, - ContentBlockStopEvent, Message, - MessageDeltaEvent, MessageStartEvent, TextBlockParam, TextDelta, @@ -1173,8 +1171,6 @@ async def test_run_async_with_params(self, chat_messages, mock_anthropic_complet # assert len(final_message.text) > 0 # assert "paris" in final_message.text.lower() - - @pytest.mark.asyncio @pytest.mark.skipif( not os.environ.get("ANTHROPIC_API_KEY", None), @@ -1317,4 +1313,3 @@ async def test_live_run_async_with_tools(self, tools): # assert "22°" in message.text # assert "12°" in message.text # assert message.meta["finish_reason"] == "end_turn" -