Class AbstractInProcessEmbeddingModel
java.lang.Object
dev.langchain4j.model.embedding.DimensionAwareEmbeddingModel
dev.langchain4j.model.embedding.onnx.AbstractInProcessEmbeddingModel
- All Implemented Interfaces:
EmbeddingModel
- Direct Known Subclasses:
AllMiniLmL6V2EmbeddingModel, AllMiniLmL6V2QuantizedEmbeddingModel, BgeSmallEnEmbeddingModel, BgeSmallEnQuantizedEmbeddingModel, BgeSmallEnV15EmbeddingModel, BgeSmallEnV15QuantizedEmbeddingModel, BgeSmallZhV15EmbeddingModel, BgeSmallZhV15QuantizedEmbeddingModel, E5SmallV2EmbeddingModel, E5SmallV2QuantizedEmbeddingModel, OnnxEmbeddingModel
-
Field Summary
Fields inherited from class DimensionAwareEmbeddingModel
dimension -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionembedAll(List<TextSegment> segments) Embeds the text content of a list ofTextSegments.protected static OnnxBertBiEncoderloadFromJar(String modelFileName, String tokenizerFileName, PoolingMode poolingMode) protected abstract OnnxBertBiEncodermodel()Methods inherited from class DimensionAwareEmbeddingModel
dimension, knownDimensionMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface EmbeddingModel
addListener, addListeners, defaultRequestParameters, doEmbed, embed, embed, embed, listeners, modelName, provider, supportedContentTypes, supportedParameters
-
Constructor Details
-
AbstractInProcessEmbeddingModel
-
-
Method Details
-
loadFromJar
protected static OnnxBertBiEncoder loadFromJar(String modelFileName, String tokenizerFileName, PoolingMode poolingMode) -
model
-
embedAll
Description copied from interface:EmbeddingModelEmbeds the text content of a list ofTextSegments.This is a convenience method over
EmbeddingModel.embed(EmbeddingRequest), solistenersare notified and the model's default per-call parameters are applied here too. A provider implements its embedding logic by overridingEmbeddingModel.doEmbed(EmbeddingRequest)(preferred); it may still override this method for batch-specific behavior that the request/response API does not carry (for example applying a document title fromTextSegmentmetadata).- Parameters:
segments- the text segments to embed.- Returns:
- the embeddings.
-