Class AbstractInProcessEmbeddingModel

java.lang.Object
dev.langchain4j.model.embedding.DimensionAwareEmbeddingModel
dev.langchain4j.model.embedding.onnx.AbstractInProcessEmbeddingModel
All Implemented Interfaces:
dev.langchain4j.model.embedding.EmbeddingModel, dev.langchain4j.model.embedding.TokenCountEstimator
Direct Known Subclasses:
OnnxEmbeddingModel

public abstract class AbstractInProcessEmbeddingModel extends dev.langchain4j.model.embedding.DimensionAwareEmbeddingModel implements dev.langchain4j.model.embedding.TokenCountEstimator
  • Field Summary

    Fields inherited from class dev.langchain4j.model.embedding.DimensionAwareEmbeddingModel

    dimension
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
     
  • Method Summary

    Modifier and Type
    Method
    Description
    dev.langchain4j.model.output.Response<List<dev.langchain4j.data.embedding.Embedding>>
    embedAll(List<dev.langchain4j.data.segment.TextSegment> segments)
     
    int
     
    protected static OnnxBertBiEncoder
    loadFromJar(String modelFileName, String tokenizerFileName, PoolingMode poolingMode)
     
    protected abstract OnnxBertBiEncoder
     

    Methods inherited from class dev.langchain4j.model.embedding.DimensionAwareEmbeddingModel

    dimension, knownDimension

    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

    Methods inherited from interface dev.langchain4j.model.embedding.TokenCountEstimator

    estimateTokenCount, estimateTokenCount
  • Constructor Details

    • AbstractInProcessEmbeddingModel

      protected AbstractInProcessEmbeddingModel(Executor executor)
  • Method Details

    • loadFromJar

      protected static OnnxBertBiEncoder loadFromJar(String modelFileName, String tokenizerFileName, PoolingMode poolingMode)
    • model

      protected abstract OnnxBertBiEncoder model()
    • embedAll

      public dev.langchain4j.model.output.Response<List<dev.langchain4j.data.embedding.Embedding>> embedAll(List<dev.langchain4j.data.segment.TextSegment> segments)
      Specified by:
      embedAll in interface dev.langchain4j.model.embedding.EmbeddingModel
    • estimateTokenCount

      public int estimateTokenCount(String text)
      Specified by:
      estimateTokenCount in interface dev.langchain4j.model.embedding.TokenCountEstimator