Package dev.langchain4j.model.embedding
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
,VertexAiEmbeddingModel
,VoyageAiEmbeddingModel
A dimension aware embedding model
-
Field Details
-
dimension
dimension of embedding
-
-
Constructor Details
-
DimensionAwareEmbeddingModel
public DimensionAwareEmbeddingModel()
-
-
Method Details
-
knownDimension
When known (e.g., can be derived from the model name), returns the dimension of theEmbedding
produced by this embedding model. Otherwise, it returnsnull
.- Returns:
- the known dimension of the
Embedding
, ornull
if unknown.
-
dimension
public int dimension()Description copied from interface:EmbeddingModel
Returns the dimension of theEmbedding
produced by this embedding model.- Specified by:
dimension
in interfaceEmbeddingModel
- Returns:
- dimension of the embedding
-