Class DimensionAwareEmbeddingModel

java.lang.Object
dev.langchain4j.model.embedding.DimensionAwareEmbeddingModel
All Implemented Interfaces:
EmbeddingModel
Direct Known Subclasses:
AzureOpenAiEmbeddingModel, CohereEmbeddingModel, GitHubModelsEmbeddingModel, HuggingFaceEmbeddingModel, JinaEmbeddingModel, JlamaEmbeddingModel, LocalAiEmbeddingModel, MistralAiEmbeddingModel, NomicEmbeddingModel, OllamaEmbeddingModel, OpenAiEmbeddingModel, QianfanEmbeddingModel, QwenEmbeddingModel, VertexAiEmbeddingModel, VoyageAiEmbeddingModel, ZhipuAiEmbeddingModel

public abstract class DimensionAwareEmbeddingModel extends Object implements EmbeddingModel
A dimension aware embedding model
  • Field Details

    • dimension

      protected Integer dimension
      dimension of embedding
  • Constructor Details

    • DimensionAwareEmbeddingModel

      public DimensionAwareEmbeddingModel()
  • Method Details

    • knownDimension

      protected Integer knownDimension()
      When known (e.g., can be derived from the model name), returns the dimension of the Embedding produced by this embedding model. Otherwise, it returns null.
      Returns:
      the known dimension of the Embedding, or null if unknown.
    • dimension

      public int dimension()
      Description copied from interface: EmbeddingModel
      Returns the dimension of the Embedding produced by this embedding model.
      Specified by:
      dimension in interface EmbeddingModel
      Returns:
      dimension of the embedding