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-12Lines changed: 3 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -393,8 +393,7 @@ def embed(
393
393
texts: List[str],
394
394
model: Optional[str] =None,
395
395
truncate: Optional[str] =None,
396
-
compress: Optional[bool] =False,
397
-
compression_codebook: Optional[str] ="default",
396
+
compression: Optional[str] =None,
398
397
input_type: Optional[str] =None,
399
398
) ->Embeddings:
400
399
"""Returns an Embeddings object for the provided texts. Visit https://cohere.ai/embed to learn about embeddings.
@@ -403,8 +402,7 @@ def embed(
403
402
text (List[str]): A list of strings to embed.
404
403
model (str): (Optional) The model ID to use for embedding the text.
405
404
truncate (str): (Optional) One of NONE|START|END, defaults to END. How the API handles text longer than the maximum token length.
406
-
compress (bool): (Optional) Whether to compress the embeddings. When True, the compressed_embeddings will be returned as integers in the range [0, 255].
407
-
compression_codebook (str): (Optional) The compression codebook to use for compressed embeddings. Defaults to "default".
405
+
compression (str): (Optional) One of "int8" or "binary". The type of compression to use for the embeddings.
408
406
input_type (str): (Optional) One of "classification", "clustering", "search_document", "search_query". The type of input text provided to embed.
409
407
"""
410
408
responses= {
@@ -420,8 +418,7 @@ def embed(
420
418
"model": model,
421
419
"texts": texts_batch,
422
420
"truncate": truncate,
423
-
"compress": compress,
424
-
"compression_codebook": compression_codebook,
421
+
"compression": compression,
425
422
"input_type": input_type,
426
423
}
427
424
)
@@ -1047,8 +1044,6 @@ def create_embed_job(
1047
1044
name: Optional[str] =None,
1048
1045
model: Optional[str] =None,
1049
1046
truncate: Optional[str] =None,
1050
-
compress: Optional[bool] =None,
1051
-
compression_codebook: Optional[str] =None,
1052
1047
text_field: Optional[str] =None,
1053
1048
) ->EmbedJob:
1054
1049
"""Create embed job.
@@ -1058,8 +1053,6 @@ def create_embed_job(
1058
1053
name (Optional[str], optional): The name of the embed job. Defaults to None.
1059
1054
model (Optional[str], optional): The model ID to use for embedding the text. Defaults to None.
1060
1055
truncate (Optional[str], optional): How the API handles text longer than the maximum token length. Defaults to None.
1061
-
compress (Optional[bool], optional): Use embedding compression. Defaults to None.
1062
-
compression_codebook (Optional[str], optional): Embedding compression codebook. Defaults to None.
1063
1056
text_field (Optional[str], optional): Name of the column containing text to embed. Defaults to None.
Copy file name to clipboardExpand all lines: cohere/client_async.py
+6-13Lines changed: 6 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -271,8 +271,7 @@ async def embed(
271
271
texts: List[str],
272
272
model: Optional[str] =None,
273
273
truncate: Optional[str] =None,
274
-
compress: Optional[bool] =False,
275
-
compression_codebook: Optional[str] ="default",
274
+
compression: Optional[str] =None,
276
275
input_type: Optional[str] =None,
277
276
) ->Embeddings:
278
277
"""Returns an Embeddings object for the provided texts. Visit https://cohere.ai/embed to learn about embeddings.
@@ -281,17 +280,15 @@ async def embed(
281
280
text (List[str]): A list of strings to embed.
282
281
model (str): (Optional) The model ID to use for embedding the text.
283
282
truncate (str): (Optional) One of NONE|START|END, defaults to END. How the API handles text longer than the maximum token length.
284
-
compress (bool): (Optional) Whether to compress the embeddings. When True, the compressed_embeddings will be returned as integers in the range [0, 255].
285
-
compression_codebook (str): (Optional) The compression codebook to use for compressed embeddings. Defaults to "default".
283
+
compression (str): (Optional) One of "int8" or "binary". The type of compression to use for the embeddings.
286
284
input_type (str): (Optional) One of "classification", "clustering", "search_document", "search_query". The type of input text provided to embed.
0 commit comments