You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: cohere/client.py
+3-6Lines changed: 3 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -395,21 +395,20 @@ def embed(
395
395
texts: List[str],
396
396
model: Optional[str] =None,
397
397
truncate: Optional[str] =None,
398
-
compression: Optional[str] =None,
399
398
input_type: Optional[str] =None,
399
+
embedding_types: Optional[List[str]] =None,
400
400
) ->Embeddings:
401
401
"""Returns an Embeddings object for the provided texts. Visit https://cohere.ai/embed to learn about embeddings.
402
402
403
403
Args:
404
404
text (List[str]): A list of strings to embed.
405
405
model (str): (Optional) The model ID to use for embedding the text.
406
406
truncate (str): (Optional) One of NONE|START|END, defaults to END. How the API handles text longer than the maximum token length.
407
-
compression (str): (Optional) One of "int8" or "binary". The type of compression to use for the embeddings.
408
407
input_type (str): (Optional) One of "classification", "clustering", "search_document", "search_query". The type of input text provided to embed.
408
+
embedding_types (List[str]): (Optional) Specifies the types of embeddings you want to get back. Not required and default is None, which returns the float embeddings in the response's embeddings field. Can be one or more of the following types: "float", "int8", "uint8", "binary", "ubinary".
Copy file name to clipboardExpand all lines: cohere/client_async.py
+3-6Lines changed: 3 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -279,25 +279,25 @@ async def embed(
279
279
texts: List[str],
280
280
model: Optional[str] =None,
281
281
truncate: Optional[str] =None,
282
-
compression: Optional[str] =None,
283
282
input_type: Optional[str] =None,
283
+
embedding_types: Optional[List[str]] =None,
284
284
) ->Embeddings:
285
285
"""Returns an Embeddings object for the provided texts. Visit https://cohere.ai/embed to learn about embeddings.
286
286
287
287
Args:
288
288
text (List[str]): A list of strings to embed.
289
289
model (str): (Optional) The model ID to use for embedding the text.
290
290
truncate (str): (Optional) One of NONE|START|END, defaults to END. How the API handles text longer than the maximum token length.
291
-
compression (str): (Optional) One of "int8" or "binary". The type of compression to use for the embeddings.
292
291
input_type (str): (Optional) One of "classification", "clustering", "search_document", "search_query". The type of input text provided to embed.
292
+
embedding_types (List[str]): (Optional) Specifies the types of embeddings you want to get back. Not required and default is None, which returns the float embeddings in the response's embeddings field. Can be one or more of the following types: "float", "int8", "uint8", "binary", "ubinary".
0 commit comments