|
2 | 2 | import string |
3 | 3 | import unittest |
4 | 4 |
|
5 | | -import pytest |
6 | 5 | from utils import get_api_key |
7 | 6 |
|
8 | 7 | import cohere |
9 | | -from cohere.error import CohereError |
10 | 8 |
|
11 | 9 | API_KEY = get_api_key() |
12 | 10 | co = cohere.Client(API_KEY) |
@@ -104,24 +102,3 @@ def test_success_multiple_batches_in_order(self): |
104 | 102 | for predictionExpected, predictionActual in zip(predictionsExpected, list(predictionsActual)): |
105 | 103 | for elementExpected, elementAcutal in zip(predictionExpected, predictionActual): |
106 | 104 | 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