EmbeddingResult

public final class EmbeddingResult


Result of an embedding request returned by EmbeddingModel.generateEmbedding.

Summary

Public constructors

EmbeddingResult(
    @NonNull EmbeddingVector embedding,
    @NonNull String modelSignature
)

Public methods

final @NonNull EmbeddingVector

The generated EmbeddingVector corresponding to the input Content.

final @NonNull String

The signature of the model that generated this embedding (matching EmbeddingModel.getModelSignature).

Public constructors

EmbeddingResult

public EmbeddingResult(
    @NonNull EmbeddingVector embedding,
    @NonNull String modelSignature
)

Public methods

getEmbedding

public final @NonNull EmbeddingVector getEmbedding()

The generated EmbeddingVector corresponding to the input Content.

getModelSignature

public final @NonNull String getModelSignature()

The signature of the model that generated this embedding (matching EmbeddingModel.getModelSignature). Embeddings generated by models with different signatures are incompatible and should not be directly compared; persist this value alongside stored vectors to detect when re-indexing is required.