Package dev.langchain4j.model.embedding
Class DimensionAwareEmbeddingModel
java.lang.Object
dev.langchain4j.model.embedding.DimensionAwareEmbeddingModel
- All Implemented Interfaces:
EmbeddingModel
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, waitMethods 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 theEmbeddingproduced by this embedding model. Otherwise, it returnsnull.- Returns:
- the known dimension of the
Embedding, ornullif unknown.
-
dimension
public int dimension()Description copied from interface:EmbeddingModelReturns the dimension of theEmbeddingproduced by this embedding model.- Specified by:
dimensionin interfaceEmbeddingModel- Returns:
- dimension of the embedding
-