Class EmbeddingRequest
Inheritance
EmbeddingRequest
Assembly: Glitch9.AIDevKit.dll
Syntax
public sealed class EmbeddingRequest : GenerativeRequest<EmbeddingRequest, EmbeddingPrompt, Embedding, IEmbeddingRequestOptions>, IGenerativeRequest
Constructors
|
Edit this page
View Source
EmbeddingRequest(EmbeddingPrompt)
Declaration
public EmbeddingRequest(EmbeddingPrompt texts)
Parameters
Properties
|
Edit this page
View Source
Dimensions
Declaration
public int Dimensions { get; set; }
Property Value
|
Edit this page
View Source
EmbedTaskType
Declaration
public EmbedTaskType EmbedTaskType { get; set; }
Property Value
|
Edit this page
View Source
Declaration
public int? MaxTokensPerInput { get; set; }
Property Value
|
Edit this page
View Source
ModelType
Declaration
public override ModelType ModelType { get; }
Property Value
Overrides
|
Edit this page
View Source
RequestType
The endpoint type for this
Declaration
public override RequestType RequestType { get; }
Property Value
Overrides
Methods
|
Edit this page
View Source
ExecuteAsyncInternal()
Executes the actual task logic. Must be implemented in derived classes.
Declaration
protected override UniTask<Generated<Embedding>> ExecuteAsyncInternal()
Returns
Overrides
|
Edit this page
View Source
SetDimensionality(int)
The dimensionality of the output embedding vector.
Must be one of the following values: 128, 256, 512, 768, 1024, 1536, 2048, 4096, 8192, 16384.
Default is 1536.
Supported models:
OpenAI: Text-embedding-3 and later modelsGoogle: All embedding models
Declaration
public EmbeddingRequest SetDimensionality(int dimensionality)
Parameters
| Type |
Name |
Description |
| int |
dimensionality |
|
Returns
|
Edit this page
View Source
SetEmbedTaskType(EmbedTaskType)
Google, Cohere Only, Optional.
Task type for which the embeddings will be used. Can only be set for models/embedding-001.
If not specified, the default is Unspecified, which lets the model choose the best type for the input content.
Declaration
public EmbeddingRequest SetEmbedTaskType(EmbedTaskType taskType)
Parameters
Returns
|
Edit this page
View Source
Cohere Only, Optional.
The maximum number of tokens to embed per input.
Declaration
public EmbeddingRequest SetMaxTokensPerInput(int maxTokens)
Parameters
| Type |
Name |
Description |
| int |
maxTokens |
|
Returns
Implements
Extension Methods