Skip to content

EmbeddingModelResponse

Namespace: Vercel.AI.Operations

public sealed class EmbeddingModelResponse

One embedding returned by a model call.

Inheritance: object

View source

EmbeddingModelResponse(IReadOnlyList<double[]>, double?, IReadOnlyList<OperationWarning>?, JsonElement?, ProviderResponse?, bool)

Section titled “EmbeddingModelResponse(IReadOnlyList<double[]>, double?, IReadOnlyList<OperationWarning>?, JsonElement?, ProviderResponse?, bool)”
public EmbeddingModelResponse(IReadOnlyList<double[]> embeddings, double? tokens = null, IReadOnlyList<OperationWarning>? warnings = null, JsonElement? providerMetadata = null, ProviderResponse? response = null, bool usageOmitted = false)

Creates a model response.

Parameters

Name Type Description
embeddings IReadOnlyList<double[]>
tokens double?
warnings IReadOnlyList<OperationWarning>
providerMetadata JsonElement?
response ProviderResponse
usageOmitted bool

View source

public IReadOnlyList<double[]> Embeddings { get; }

Vectors in request order.

Value: IReadOnlyList<double[]>

View source

public JsonElement? ProviderMetadata { get; }

Provider metadata.

Value: JsonElement?

View source

public ProviderResponse? Response { get; }

Raw response.

Value: ProviderResponse

View source

public double Tokens { get; }

Token count. NaN when the provider omitted usage.

Value: double

View source

public IReadOnlyList<OperationWarning> Warnings { get; }

Provider warnings. Missing warnings become an empty list.

Value: IReadOnlyList<OperationWarning>

View source

Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product