diff --git a/integrations/cohere/src/haystack_integrations/components/embedders/document_embedder.py b/integrations/cohere/src/haystack_integrations/components/embedders/document_embedder.py index 2d8895948..77d88a395 100644 --- a/integrations/cohere/src/haystack_integrations/components/embedders/document_embedder.py +++ b/integrations/cohere/src/haystack_integrations/components/embedders/document_embedder.py @@ -3,10 +3,11 @@ # SPDX-License-Identifier: Apache-2.0 import asyncio import os +from typing import Any, Dict, List, Optional + from cohere import COHERE_API_URL, AsyncClient, Client from haystack import Document, component, default_to_dict from haystack_integrations.components.embedders.utils import get_async_response, get_response -from typing import Any, Dict, List, Optional @component diff --git a/integrations/cohere/src/haystack_integrations/components/embedders/text_embedder.py b/integrations/cohere/src/haystack_integrations/components/embedders/text_embedder.py index 0805844bd..be4c867fa 100644 --- a/integrations/cohere/src/haystack_integrations/components/embedders/text_embedder.py +++ b/integrations/cohere/src/haystack_integrations/components/embedders/text_embedder.py @@ -3,10 +3,11 @@ # SPDX-License-Identifier: Apache-2.0 import asyncio import os +from typing import Any, Dict, List, Optional + from cohere import COHERE_API_URL, AsyncClient, Client from haystack import component, default_to_dict from haystack_integrations.components.embedders.utils import get_async_response, get_response -from typing import Any, Dict, List, Optional @component diff --git a/integrations/cohere/src/haystack_integrations/components/generators/chat/chat_generator.py b/integrations/cohere/src/haystack_integrations/components/generators/chat/chat_generator.py index 7b7410c70..0ff29ce14 100644 --- a/integrations/cohere/src/haystack_integrations/components/generators/chat/chat_generator.py +++ b/integrations/cohere/src/haystack_integrations/components/generators/chat/chat_generator.py @@ -1,10 +1,11 @@ import logging import os +from typing import Any, Callable, Dict, List, Optional + from haystack import component, default_from_dict, default_to_dict from haystack.components.generators.utils import deserialize_callback_handler, serialize_callback_handler from haystack.dataclasses import ChatMessage, ChatRole, StreamingChunk from haystack.lazy_imports import LazyImport -from typing import Any, Callable, Dict, List, Optional with LazyImport(message="Run 'pip install cohere'") as cohere_import: import cohere diff --git a/integrations/cohere/src/haystack_integrations/components/generators/generator.py b/integrations/cohere/src/haystack_integrations/components/generators/generator.py index bc952cb83..9917f17ea 100644 --- a/integrations/cohere/src/haystack_integrations/components/generators/generator.py +++ b/integrations/cohere/src/haystack_integrations/components/generators/generator.py @@ -4,10 +4,11 @@ import logging import os import sys +from typing import Any, Callable, Dict, List, Optional, cast + from cohere import COHERE_API_URL, Client from cohere.responses import Generations from haystack import DeserializationError, component, default_from_dict, default_to_dict -from typing import Any, Callable, Dict, List, Optional, cast logger = logging.getLogger(__name__) diff --git a/integrations/cohere/tests/test_cohere_chat_generator.py b/integrations/cohere/tests/test_cohere_chat_generator.py index 3677f92e4..b3502d51e 100644 --- a/integrations/cohere/tests/test_cohere_chat_generator.py +++ b/integrations/cohere/tests/test_cohere_chat_generator.py @@ -5,7 +5,6 @@ import pytest from haystack.components.generators.utils import default_streaming_callback from haystack.dataclasses import ChatMessage, ChatRole, StreamingChunk - from haystack_integrations.components.generators.chat import CohereChatGenerator pytestmark = pytest.mark.chat_generators diff --git a/integrations/cohere/tests/test_cohere_generators.py b/integrations/cohere/tests/test_cohere_generators.py index 029af4533..bc98731d0 100644 --- a/integrations/cohere/tests/test_cohere_generators.py +++ b/integrations/cohere/tests/test_cohere_generators.py @@ -5,7 +5,6 @@ import pytest from cohere import COHERE_API_URL - from haystack_integrations.components.generators import CohereGenerator pytestmark = pytest.mark.generators diff --git a/integrations/cohere/tests/test_document_embedder.py b/integrations/cohere/tests/test_document_embedder.py index 571e8d419..5cc8eb745 100644 --- a/integrations/cohere/tests/test_document_embedder.py +++ b/integrations/cohere/tests/test_document_embedder.py @@ -6,7 +6,6 @@ import pytest from cohere import COHERE_API_URL from haystack import Document - from haystack_integrations.components.embedders import CohereDocumentEmbedder pytestmark = pytest.mark.embedders diff --git a/integrations/cohere/tests/test_text_embedder.py b/integrations/cohere/tests/test_text_embedder.py index 55ee985d3..825b62942 100644 --- a/integrations/cohere/tests/test_text_embedder.py +++ b/integrations/cohere/tests/test_text_embedder.py @@ -5,7 +5,6 @@ import pytest from cohere import COHERE_API_URL - from haystack_integrations.components.embedders import CohereTextEmbedder pytestmark = pytest.mark.embedders