diff --git a/integrations/cohere/examples/cohere_embedding.py b/integrations/cohere/examples/cohere_embedding.py index e6fe3cc35..75131de86 100644 --- a/integrations/cohere/examples/cohere_embedding.py +++ b/integrations/cohere/examples/cohere_embedding.py @@ -1,6 +1,7 @@ from haystack import Document, Pipeline from haystack.components.retrievers.in_memory import InMemoryEmbeddingRetriever from haystack.document_stores.in_memory import InMemoryDocumentStore + from haystack_integrations.components.embedders.cohere.document_embedder import CohereDocumentEmbedder from haystack_integrations.components.embedders.cohere.text_embedder import CohereTextEmbedder diff --git a/integrations/cohere/examples/cohere_generation.py b/integrations/cohere/examples/cohere_generation.py index cd79e37d3..3baec6327 100644 --- a/integrations/cohere/examples/cohere_generation.py +++ b/integrations/cohere/examples/cohere_generation.py @@ -20,6 +20,7 @@ from haystack.components.joiners import BranchJoiner from haystack.components.validators import JsonSchemaValidator from haystack.dataclasses import ChatMessage + from haystack_integrations.components.generators.cohere import CohereChatGenerator # Defines a JSON schema for validating a person's data. The schema specifies that a valid object must diff --git a/integrations/cohere/examples/cohere_ranker.py b/integrations/cohere/examples/cohere_ranker.py index 79a3d346d..b66ca1aae 100644 --- a/integrations/cohere/examples/cohere_ranker.py +++ b/integrations/cohere/examples/cohere_ranker.py @@ -1,6 +1,7 @@ from haystack import Document, Pipeline from haystack.components.retrievers.in_memory import InMemoryBM25Retriever from haystack.document_stores.in_memory import InMemoryDocumentStore + from haystack_integrations.components.rankers.cohere import CohereRanker # Note set your API key by running the below command in your terminal diff --git a/integrations/cohere/pyproject.toml b/integrations/cohere/pyproject.toml index 04fe15585..add8dc150 100644 --- a/integrations/cohere/pyproject.toml +++ b/integrations/cohere/pyproject.toml @@ -41,7 +41,12 @@ root = "../.." git_describe_command = 'git describe --tags --match="integrations/cohere-v[0-9]*"' [tool.hatch.envs.default] -dependencies = ["coverage[toml]>=6.5", "pytest", "pytest-rerunfailures", "haystack-pydoc-tools"] +dependencies = [ + "coverage[toml]>=6.5", + "pytest", + "pytest-rerunfailures", + "haystack-pydoc-tools", +] [tool.hatch.envs.default.scripts] test = "pytest {args:tests}" test-cov = "coverage run -m pytest {args:tests}" @@ -59,8 +64,11 @@ detached = true dependencies = ["black>=23.1.0", "mypy>=1.0.0", "ruff>=0.0.243"] [tool.hatch.envs.lint.scripts] typing = "mypy --install-types --non-interactive --explicit-package-bases {args:src/ tests}" -style = ["ruff check {args:.}", "black --check --diff {args:.}"] -fmt = ["black {args:.}", "ruff --fix {args:.}", "style"] +style = [ + "ruff check {args:. --exclude tests/}", + "black --check --diff {args:.}", +] +fmt = ["black {args:.}", "ruff --fix {args:. --exclude tests/}", "style"] all = ["style", "typing"] [tool.black] diff --git a/integrations/cohere/src/haystack_integrations/components/embedders/cohere/document_embedder.py b/integrations/cohere/src/haystack_integrations/components/embedders/cohere/document_embedder.py index 59a04cf3c..3201168a8 100644 --- a/integrations/cohere/src/haystack_integrations/components/embedders/cohere/document_embedder.py +++ b/integrations/cohere/src/haystack_integrations/components/embedders/cohere/document_embedder.py @@ -6,9 +6,9 @@ from haystack import Document, component, default_from_dict, default_to_dict from haystack.utils import Secret, deserialize_secrets_inplace -from haystack_integrations.components.embedders.cohere.utils import get_async_response, get_response from cohere import AsyncClient, Client +from haystack_integrations.components.embedders.cohere.utils import get_async_response, get_response @component diff --git a/integrations/cohere/src/haystack_integrations/components/embedders/cohere/text_embedder.py b/integrations/cohere/src/haystack_integrations/components/embedders/cohere/text_embedder.py index 80ede51bf..c1e9bd613 100644 --- a/integrations/cohere/src/haystack_integrations/components/embedders/cohere/text_embedder.py +++ b/integrations/cohere/src/haystack_integrations/components/embedders/cohere/text_embedder.py @@ -6,9 +6,9 @@ from haystack import component, default_from_dict, default_to_dict from haystack.utils import Secret, deserialize_secrets_inplace -from haystack_integrations.components.embedders.cohere.utils import get_async_response, get_response from cohere import AsyncClient, Client +from haystack_integrations.components.embedders.cohere.utils import get_async_response, get_response @component