GoogleMultimodalEmbedding
Namespace: Vercel.AI.Operations
public sealed class GoogleMultimodalEmbedding : IEmbeddingCallerGemini embedding caller used by EmbedMany.
Splits multimodal google.content to the chunk that is about to be sent
and posts embedContent or batchEmbedContents.
Inheritance: object
Implements: IEmbeddingCaller
Constructors
Section titled “Constructors”GoogleMultimodalEmbedding(string, HttpClient, string?)
Section titled “GoogleMultimodalEmbedding(string, HttpClient, string?)”public GoogleMultimodalEmbedding(string modelId, HttpClient http, string? baseUrl = null)Creates a caller that posts to <code class=“paramref”>baseUrl</code>.
Parameters
| Name | Type | Description |
|---|---|---|
modelId |
string | |
http |
HttpClient | |
baseUrl |
string |
Fields
Section titled “Fields”EmbeddingsPerCall
Section titled “EmbeddingsPerCall”public const int EmbeddingsPerCall = 100Values accepted by one Gemini embedding request.
Value: int
Properties
Section titled “Properties”MaxEmbeddingsPerCall
Section titled “MaxEmbeddingsPerCall”public int? MaxEmbeddingsPerCall { get; }Maximum values per call. Null means unlimited.
Value: int?
MaxInputBytesPerCall
Section titled “MaxInputBytesPerCall”public double? MaxInputBytesPerCall { get; }Maximum UTF-8 input bytes per call. Null and infinity mean unlimited.
Value: double?
ModelId
Section titled “ModelId”public string ModelId { get; }Model id.
Value: string
Provider
Section titled “Provider”public string Provider { get; }Provider id.
Value: string
SpecificationVersion
Section titled “SpecificationVersion”public string SpecificationVersion { get; }Specification version. v4 is current. v2 omits warnings.
Value: string
SupportsParallelCalls
Section titled “SupportsParallelCalls”public bool SupportsParallelCalls { get; }Whether chunks may run at the same time.
Value: bool
Methods
Section titled “Methods”DoEmbedAsync(EmbeddingModelCall, CancellationToken)
Section titled “DoEmbedAsync(EmbeddingModelCall, CancellationToken)”public Task<EmbeddingModelResponse> DoEmbedAsync(EmbeddingModelCall call, CancellationToken cancellationToken)Embeds one chunk.
Parameters
| Name | Type | Description |
|---|---|---|
call |
EmbeddingModelCall | |
cancellationToken |
CancellationToken |
Returns: Task<EmbeddingModelResponse>
TransformProviderOptionsAsync(JsonElement?, IReadOnlyList<string>, int, int, CancellationToken)
Section titled “TransformProviderOptionsAsync(JsonElement?, IReadOnlyList<string>, int, int, CancellationToken)”public Task<JsonElement?> TransformProviderOptionsAsync(JsonElement? providerOptions, IReadOnlyList<string> values, int startIndex, int endIndex, CancellationToken cancellationToken)Slices provider options for one chunk. Null leaves the options unchanged.
Parameters
| Name | Type | Description |
|---|---|---|
providerOptions |
JsonElement? | |
values |
IReadOnlyList<string> | |
startIndex |
int | |
endIndex |
int | |
cancellationToken |
CancellationToken |
Returns: Task<JsonElement?>
Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product