Skip to content

Commit 2416684

Browse files
authored
remove tests for new embed model (cohere-ai#311)
* remove tests for new embed model * update changelog
1 parent 000b83b commit 2416684

2 files changed

Lines changed: 4 additions & 23 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 4.29
4+
- [#311] (https://github.com/cohere-ai/cohere-python/pull/311)
5+
- Embed: remove embed input_type tests
6+
37
## 4.28
48
- [#310] (https://github.com/cohere-ai/cohere-python/pull/310)
59
- Embed: add input_type parameter for new embed models

tests/sync/test_embed.py

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@
22
import string
33
import unittest
44

5-
import pytest
65
from utils import get_api_key
76

87
import cohere
9-
from cohere.error import CohereError
108

119
API_KEY = get_api_key()
1210
co = cohere.Client(API_KEY)
@@ -104,24 +102,3 @@ def test_success_multiple_batches_in_order(self):
104102
for predictionExpected, predictionActual in zip(predictionsExpected, list(predictionsActual)):
105103
for elementExpected, elementAcutal in zip(predictionExpected, predictionActual):
106104
self.assertAlmostEqual(elementExpected, elementAcutal, places=1)
107-
108-
def test_fail_with_new_model_no_input_type(self):
109-
text_batch = random_texts(cohere.COHERE_EMBED_BATCH_SIZE)
110-
with pytest.raises(CohereError):
111-
co.embed(model="embed-english-v3.0", texts=text_batch)
112-
113-
def test_fail_with_new_model_invalid_input_type(self):
114-
text_batch = random_texts(cohere.COHERE_EMBED_BATCH_SIZE)
115-
input_type = "invalid"
116-
with pytest.raises(CohereError):
117-
co.embed(model="embed-english-v3.0", texts=text_batch, input_type=input_type)
118-
119-
def test_success_with_new_model_and_input_type(self):
120-
text = ["cohere"]
121-
input_types = ["classification", "search_document", "search_query", "clustering"]
122-
123-
for input_type in input_types:
124-
prediction = co.embed(model="embed-english-v3.0", texts=text, input_type=input_type)
125-
embed = prediction.embeddings[0]
126-
self.assertIsInstance(embed, list)
127-
self.assertEqual(len(embed), 1024)

0 commit comments

Comments
 (0)