From 41bdfb8ef5af739344be1e2307b49bd0eabe1766 Mon Sep 17 00:00:00 2001 From: Vladimir Blagojevic Date: Fri, 19 Jan 2024 15:04:43 +0100 Subject: [PATCH] Fix lint issues --- .../haystack_integrations/components/embedders/__init__.py | 2 +- .../components/embedders/document_embedder.py | 4 +--- .../components/embedders/text_embedder.py | 4 +--- .../haystack_integrations/components/generators/__init__.py | 2 +- .../components/generators/chat/__init__.py | 2 +- .../components/generators/chat/chat_generator.py | 3 +-- .../haystack_integrations/components/generators/generator.py | 3 +-- 7 files changed, 7 insertions(+), 13 deletions(-) diff --git a/integrations/cohere/src/haystack_integrations/components/embedders/__init__.py b/integrations/cohere/src/haystack_integrations/components/embedders/__init__.py index c4546eb30..73a863a73 100644 --- a/integrations/cohere/src/haystack_integrations/components/embedders/__init__.py +++ b/integrations/cohere/src/haystack_integrations/components/embedders/__init__.py @@ -4,4 +4,4 @@ from .document_embedder import CohereDocumentEmbedder from .text_embedder import CohereTextEmbedder -__all__ = ["CohereDocumentEmbedder", "CohereTextEmbedder"] \ No newline at end of file +__all__ = ["CohereDocumentEmbedder", "CohereTextEmbedder"] 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 e8b952c09..2d8895948 100644 --- a/integrations/cohere/src/haystack_integrations/components/embedders/document_embedder.py +++ b/integrations/cohere/src/haystack_integrations/components/embedders/document_embedder.py @@ -3,12 +3,10 @@ # 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 90dd07918..0805844bd 100644 --- a/integrations/cohere/src/haystack_integrations/components/embedders/text_embedder.py +++ b/integrations/cohere/src/haystack_integrations/components/embedders/text_embedder.py @@ -3,12 +3,10 @@ # 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/__init__.py b/integrations/cohere/src/haystack_integrations/components/generators/__init__.py index 0a6808be5..c36f982df 100644 --- a/integrations/cohere/src/haystack_integrations/components/generators/__init__.py +++ b/integrations/cohere/src/haystack_integrations/components/generators/__init__.py @@ -3,4 +3,4 @@ # SPDX-License-Identifier: Apache-2.0 from .generator import CohereGenerator -__all__ = ["CohereGenerator"] \ No newline at end of file +__all__ = ["CohereGenerator"] diff --git a/integrations/cohere/src/haystack_integrations/components/generators/chat/__init__.py b/integrations/cohere/src/haystack_integrations/components/generators/chat/__init__.py index b56dd2e15..dc14c9c1c 100644 --- a/integrations/cohere/src/haystack_integrations/components/generators/chat/__init__.py +++ b/integrations/cohere/src/haystack_integrations/components/generators/chat/__init__.py @@ -3,4 +3,4 @@ # SPDX-License-Identifier: Apache-2.0 from .chat_generator import CohereChatGenerator -__all__ = ["CohereChatGenerator"] \ No newline at end of file +__all__ = ["CohereChatGenerator"] 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 0ff29ce14..7b7410c70 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,11 +1,10 @@ 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 9917f17ea..bc952cb83 100644 --- a/integrations/cohere/src/haystack_integrations/components/generators/generator.py +++ b/integrations/cohere/src/haystack_integrations/components/generators/generator.py @@ -4,11 +4,10 @@ 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__)