Package dev.langchain4j.model.embedding
Class DimensionAwareEmbeddingModel
java.lang.Object
dev.langchain4j.model.embedding.DimensionAwareEmbeddingModel
- All Implemented Interfaces:
EmbeddingModel
- Direct Known Subclasses:
AzureOpenAiEmbeddingModel
,CohereEmbeddingModel
,HuggingFaceEmbeddingModel
,JinaEmbeddingModel
,JlamaEmbeddingModel
,LocalAiEmbeddingModel
,MistralAiEmbeddingModel
,NomicEmbeddingModel
,OllamaEmbeddingModel
,OpenAiEmbeddingModel
,QianfanEmbeddingModel
,QwenEmbeddingModel
,VertexAiEmbeddingModel
,ZhipuAiEmbeddingModel
A dimension aware embedding model
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface dev.langchain4j.model.embedding.EmbeddingModel
embed, embed, embedAll
-
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
-