Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions integrations/cohere/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ line-length = 120
[tool.ruff.lint]
select = [
"A",
"ANN",
"ARG",
"B",
"C",
Expand Down Expand Up @@ -124,6 +125,8 @@ ignore = [
# Misc
"B008",
"S101",
# Allow `Any` - used legitimately for dynamic types and SDK boundaries
"ANN401",
]

[tool.ruff.lint.isort]
Expand All @@ -133,8 +136,8 @@ known-first-party = ["haystack_integrations"]
ban-relative-imports = "parents"

[tool.ruff.lint.per-file-ignores]
# Tests can use magic values, assertions, and relative imports
"tests/**/*" = ["PLR2004", "S101", "TID252"]
# Tests can use magic values, assertions, relative imports, and don't need type annotations
"tests/**/*" = ["PLR2004", "S101", "TID252", "ANN"]

[tool.coverage.run]
source = ["haystack_integrations"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def __init__(
meta_fields_to_embed: list[str] | None = None,
embedding_separator: str = "\n",
embedding_type: EmbeddingTypes | None = None,
):
) -> None:
"""
:param api_key: the Cohere API key.
:param model: the name of the model to use. Supported Models are:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class EmbeddingTypes(Enum):
BINARY = "binary"
UBINARY = "ubinary"

def __str__(self):
def __str__(self) -> str:
return self.value

@staticmethod
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def __init__(
truncate: str = "END",
timeout: float = 120.0,
embedding_type: EmbeddingTypes | None = None,
):
) -> None:
"""
:param api_key: the Cohere API key.
:param model: the name of the model to use. Supported Models are:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ def __init__(
*,
timeout: float | None = None,
max_retries: int | None = None,
):
) -> None:
"""
Initialize the CohereChatGenerator instance.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def __init__(
streaming_callback: Callable | None = None,
api_base_url: str | None = None,
**kwargs: Any,
):
) -> None:
"""
Instantiates a `CohereGenerator` component.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def __init__(
meta_fields_to_embed: list[str] | None = None,
meta_data_separator: str = "\n",
max_tokens_per_doc: int = 4096,
):
) -> None:
"""
Creates an instance of the 'CohereRanker'.

Expand Down
Loading