Interface EmbeddingService

  • All Implemented Interfaces:
    com.embabel.common.ai.model.AiModel , com.embabel.common.ai.model.EmbeddingServiceMetadata , com.embabel.common.ai.model.ModelMetadata , com.embabel.common.core.types.HasInfoString

    
    public interface EmbeddingService
     implements AiModel<Any>, EmbeddingServiceMetadata
                        

    Embed text in vector space

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      abstract FloatArray embed(String text) Embed a single text in vector space
      abstract List<FloatArray> embed(List<String> texts) Embed multiple texts in vector space Use this method for better performance when embedding multiple texts
      abstract Integer getDimensions() Dimension of the embedding vectors produced by this model
      • Methods inherited from class com.embabel.common.ai.model.AiModel

        getModel, infoString
      • Methods inherited from class com.embabel.common.ai.model.ModelMetadata

        getName, getProvider, getType
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • embed

         abstract FloatArray embed(String text)

        Embed a single text in vector space

        Returns:

        embedding vector

      • embed

         abstract List<FloatArray> embed(List<String> texts)

        Embed multiple texts in vector space Use this method for better performance when embedding multiple texts

        Returns:

        list of embedding vectors corresponding to the input texts

      • getDimensions

         abstract Integer getDimensions()

        Dimension of the embedding vectors produced by this model