Class CohereEmbeddingRequest
Inherited Members
Namespace: Glitch9.AIDevKit.Cohere
Assembly: Glitch9.AIDevKit.Provider.Cohere.dll
Syntax
public class CohereEmbeddingRequest
Properties
| Edit this page View SourceEmbeddingTypes
Optional. Specifies the types of embeddings you want to get back. Can be one or more of the following types.
"float": Use this when you want to get back the default float embeddings. Supported with all Embed models. "int8": Use this when you want to get back signed int8 embeddings. Supported with Embed v3.0 and newer Embed models. "uint8": Use this when you want to get back unsigned int8 embeddings. Supported with Embed v3.0 and newer Embed models. "binary": Use this when you want to get back signed binary embeddings. Supported with Embed v3.0 and newer Embed models. "ubinary": Use this when you want to get back unsigned binary embeddings. Supported with Embed v3.0 and newer Embed models. "base64": Use this when you want to get back base64 embeddings. Supported with Embed v3.0 and newer Embed models.
Declaration
[JsonConverter(typeof(FlagsToArrayConverter<EmbedTypes>))]
[JsonProperty("embedding_types")]
public EmbedTypes EmbeddingTypes { get; set; }
Property Value
| Type | Description |
|---|---|
| EmbedTypes |
Images
Optional. An array of image data URIs for the model to embed. Maximum number of images per call is 1.
The image must be a valid data URI. The image must be in either image/jpeg, image/png, image/webp, or image/gif format and has a maximum size of 5MB.
Image embeddings are supported with Embed v3.0 and newer models.
Declaration
[JsonProperty("images")]
public string[] Images { get; set; }
Property Value
| Type | Description |
|---|---|
| string[] |
InputType
Required. Specifies the type of input passed to the model. Required for embedding models v3 and higher.
"search_document": Used for embeddings stored in a vector database for search use-cases. "search_query": Used for embeddings of search queries run against a vector DB to find relevant documents. "classification": Used for embeddings passed through a text classifier. "clustering": Used for the embeddings run through a clustering algorithm. "image": Used for embeddings with image input.
Declaration
[JsonProperty("prompt_type")]
public EmbedTaskType InputType { get; set; }
Property Value
| Type | Description |
|---|---|
| EmbedTaskType |
Inputs
Optional. An array of inputs for the model to embed. Maximum number of inputs per call is 96. An input can contain a mix of text and image components.
Declaration
[JsonProperty("inputs")]
public EmbedTaskType[] Inputs { get; set; }
Property Value
| Type | Description |
|---|---|
| EmbedTaskType[] |
MaxTokens
Optional. The maximum number of tokens to embed per input. If the input text is longer than this, it will be truncated according to the truncate parameter.
Declaration
[JsonProperty("max_tokens")]
public int? MaxTokens { get; set; }
Property Value
| Type | Description |
|---|---|
| int? |
Model
Required. ID of one of the available Embedding models.
Declaration
[JsonProperty("model")]
public string Model { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
OutputDimension
Optional. The number of dimensions of the output embedding. This is only available for embed-v4 and newer models. Possible values are 256, 512, 1024, and 1536. The default is 1536.
Declaration
[JsonProperty("output_dimension")]
public int? OutputDimension { get; set; }
Property Value
| Type | Description |
|---|---|
| int? |
Priority
Optional. Controls how early the request is handled. Lower numbers indicate higher priority (default: 0, the highest). When the system is under load, higher-priority requests are processed first and are the least likely to be dropped.
0-999 Defaults to 0
Declaration
[JsonProperty("priority")]
public int? Priority { get; set; }
Property Value
| Type | Description |
|---|---|
| int? |
Texts
Optional. An array of strings for the model to embed. Maximum number of texts per call is 96.
Declaration
[JsonProperty("texts")]
public string[] Texts { get; set; }
Property Value
| Type | Description |
|---|---|
| string[] |
Truncate
Optional. One of NONE|START|END to specify how the API will handle inputs longer than the maximum token length.
Passing START will discard the start of the input. END will discard the end of the input. In both cases, input is discarded until the remaining input is exactly the maximum input token length for the model.
If NONE is selected, when the input exceeds the maximum input token length an error will be returned.
Defaults to END
Declaration
[JsonProperty("truncate")]
public CohereEmbedTruncateType? Truncate { get; set; }
Property Value
| Type | Description |
|---|---|
| CohereEmbedTruncateType? |