Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore!: Rename model_name to model in the Cohere integration #222

Merged
merged 9 commits into from
Jan 17, 2024
Prev Previous commit
Next Next commit
fix document embedder tests
  • Loading branch information
ZanSara committed Jan 16, 2024
commit 346fa1d0f360e5daef932fa149541433a4bb6004
12 changes: 6 additions & 6 deletions integrations/cohere/tests/test_document_embedder.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class TestCohereDocumentEmbedder:
def test_init_default(self):
embedder = CohereDocumentEmbedder(api_key="test-api-key")
assert embedder.api_key == "test-api-key"
assert embedder.model_name == "embed-english-v2.0"
assert embedder.model == "embed-english-v2.0"
assert embedder.input_type == "search_document"
assert embedder.api_base_url == COHERE_API_URL
assert embedder.truncate == "END"
Expand All @@ -31,7 +31,7 @@ def test_init_default(self):
def test_init_with_parameters(self):
embedder = CohereDocumentEmbedder(
api_key="test-api-key",
model_name="embed-multilingual-v2.0",
model="embed-multilingual-v2.0",
input_type="search_query",
api_base_url="https://custom-api-base-url.com",
truncate="START",
Expand All @@ -44,7 +44,7 @@ def test_init_with_parameters(self):
embedding_separator="-",
)
assert embedder.api_key == "test-api-key"
assert embedder.model_name == "embed-multilingual-v2.0"
assert embedder.model == "embed-multilingual-v2.0"
assert embedder.input_type == "search_query"
assert embedder.api_base_url == "https://custom-api-base-url.com"
assert embedder.truncate == "START"
Expand All @@ -62,7 +62,7 @@ def test_to_dict(self):
assert component_dict == {
"type": "cohere_haystack.embedders.document_embedder.CohereDocumentEmbedder",
"init_parameters": {
"model_name": "embed-english-v2.0",
"model": "embed-english-v2.0",
"input_type": "search_document",
"api_base_url": COHERE_API_URL,
"truncate": "END",
Expand All @@ -79,7 +79,7 @@ def test_to_dict(self):
def test_to_dict_with_custom_init_parameters(self):
embedder_component = CohereDocumentEmbedder(
api_key="test-api-key",
model_name="embed-multilingual-v2.0",
model="embed-multilingual-v2.0",
input_type="search_query",
api_base_url="https://custom-api-base-url.com",
truncate="START",
Expand All @@ -95,7 +95,7 @@ def test_to_dict_with_custom_init_parameters(self):
assert component_dict == {
"type": "cohere_haystack.embedders.document_embedder.CohereDocumentEmbedder",
"init_parameters": {
"model_name": "embed-multilingual-v2.0",
"model": "embed-multilingual-v2.0",
"input_type": "search_query",
"api_base_url": "https://custom-api-base-url.com",
"truncate": "START",
Expand Down