Table of Contents

Class GeminiBatchEmbedContentRequest

Generates multiple embeddings from the model given input text in a synchronous call.

public class GeminiBatchEmbedContentRequest : IGeminiPostRequest, IGeminiRequest
Inheritance
GeminiBatchEmbedContentRequest
Implements
Extension Methods

Constructors

GeminiBatchEmbedContentRequest(GeminiModelId, bool)

public GeminiBatchEmbedContentRequest(GeminiModelId model, bool useBetaApi = false)

Parameters

model GeminiModelId

The model to use.

useBetaApi bool

Should the request use the Beta API?

Fields

ApiVersion

The API version to use.

public string ApiVersion

Field Value

string

Model

The model to use.

public GeminiModelId Model

Field Value

GeminiModelId

Requests

Embed requests for the batch. The model in each of these requests must match the model specified in Model.

public GeminiEmbedContentRequest[] Requests

Field Value

GeminiEmbedContentRequest[]

Properties

AuthMethod

The preferred authentication method.

public GeminiAuthMethod AuthMethod { get; set; }

Property Value

GeminiAuthMethod

ContentType

The MIME type of the request content.

public string ContentType { get; }

Property Value

string

OAuthAccessToken

The OAuth access token to authenticate the request, if using OAuthAccessToken as AuthMethod.

public string OAuthAccessToken { get; set; }

Property Value

string

Methods

GetEndpointUri(GeminiRequestMetadata)

Gets the URI to the API endpoint.

public string GetEndpointUri(GeminiRequestMetadata metadata)

Parameters

metadata GeminiRequestMetadata

The metadata of the request to be carried out on the URI.

Returns

string

The URI.

GetUtf8EncodedData()

Converts the request object to a UTF-8 encoded string.

public string GetUtf8EncodedData()

Returns

string

The string data.