Interface EmbeddingModel

All Known Implementing Classes:
AbstractBedrockEmbeddingModel, AzureOpenAiEmbeddingModel, BedrockTitanEmbeddingModel, CohereEmbeddingModel, DimensionAwareEmbeddingModel, DisabledEmbeddingModel, GitHubModelsEmbeddingModel, GoogleAiEmbeddingModel, HuggingFaceEmbeddingModel, JinaEmbeddingModel, JlamaEmbeddingModel, LocalAiEmbeddingModel, MistralAiEmbeddingModel, NomicEmbeddingModel, OllamaEmbeddingModel, OpenAiEmbeddingModel, OvhAiEmbeddingModel, QianfanEmbeddingModel, QwenEmbeddingModel, VertexAiEmbeddingModel, VoyageAiEmbeddingModel, WorkersAiEmbeddingModel, ZhipuAiEmbeddingModel

public interface EmbeddingModel
Represents a model that can convert a given text into an embedding (vector representation of the text).
  • Method Details

    • embed

      default Response<Embedding> embed(String text)
      Embed a text.
      Parameters:
      text - the text to embed.
      Returns:
      the embedding.
    • embed

      default Response<Embedding> embed(TextSegment textSegment)
      Embed the text content of a TextSegment.
      Parameters:
      textSegment - the text segment to embed.
      Returns:
      the embedding.
    • embedAll

      Response<List<Embedding>> embedAll(List<TextSegment> textSegments)
      Embeds the text content of a list of TextSegments.
      Parameters:
      textSegments - the text segments to embed.
      Returns:
      the embeddings.
    • dimension

      default int dimension()
      Returns the dimension of the Embedding produced by this embedding model.
      Returns:
      dimension of the embedding