UGemini 2.0.1
A C# wrapper for the Google Gemini API.
|
Generates an embedding from the model. More...
Public Member Functions | |||
string | GetEndpointUri (GeminiRequestMetadata metadata) | ||
Gets the URI to the API endpoint.
| |||
GeminiEmbedContentRequest (GeminiModelId model, bool useBetaApi=false) | |||
Creates a new GeminiEmbedContentRequest. | |||
string | GetUtf8EncodedData () | ||
Converts the request object to a UTF-8 encoded string.
| |||
Public Attributes | |
GeminiContent | Content |
The content to embed. Only the GeminiContentPart.Text fields will be counted. | |
GeminiEmbedTaskType | TaskType = GeminiEmbedTaskType.Unspecified |
Optional task type for which the embeddings will be used. | |
string | Title = null |
An optional title for the text. Only applicable when TaskType is GeminiEmbedTaskType.RetrievalDocument. | |
int | OutputDimensionality = -1 |
Optional reduced dimension for the output embedding. | |
GeminiModelId | Model |
The model to use. | |
string | ApiVersion |
The API version to use. | |
Properties | |
string | ContentType [get] |
The MIME type of the request content. | |
Properties inherited from Uralstech.UGemini.IGeminiPostRequest |
Generates an embedding from the model.
Uralstech.UGemini.Models.Embedding.GeminiEmbedContentRequest.GeminiEmbedContentRequest | ( | GeminiModelId | model, |
bool | useBetaApi = false ) |
Creates a new GeminiEmbedContentRequest.
model | The model to use. |
useBetaApi | Should the request use the Beta API? |
string Uralstech.UGemini.Models.Embedding.GeminiEmbedContentRequest.GetEndpointUri | ( | GeminiRequestMetadata | metadata | ) |
Gets the URI to the API endpoint.
metadata | The metadata of the request to be carried out on the URI. |
Implements Uralstech.UGemini.IGeminiRequest.
string Uralstech.UGemini.Models.Embedding.GeminiEmbedContentRequest.GetUtf8EncodedData | ( | ) |
Converts the request object to a UTF-8 encoded string.
Implements Uralstech.UGemini.IGeminiPostRequest.
int Uralstech.UGemini.Models.Embedding.GeminiEmbedContentRequest.OutputDimensionality = -1 |
Optional reduced dimension for the output embedding.
If set, excessive values in the output embedding are truncated from the end. Supported by
newer models since 2024, and the earlier model (models/embedding-001) cannot specify this value.
GeminiEmbedTaskType Uralstech.UGemini.Models.Embedding.GeminiEmbedContentRequest.TaskType = GeminiEmbedTaskType.Unspecified |
Optional task type for which the embeddings will be used.
Can only be set for "models/embedding-001" model.
string Uralstech.UGemini.Models.Embedding.GeminiEmbedContentRequest.Title = null |
An optional title for the text. Only applicable when TaskType is GeminiEmbedTaskType.RetrievalDocument.
Specifying a this for GeminiEmbedTaskType.RetrievalDocument provides better quality embeddings for retrieval.
|
get |
The MIME type of the request content.
Implements Uralstech.UGemini.IGeminiPostRequest.