Class GoogleGenAiEmbeddingModel

java.lang.Object
dev.langchain4j.model.embedding.DimensionAwareEmbeddingModel
dev.langchain4j.model.google.genai.GoogleGenAiEmbeddingModel
All Implemented Interfaces:
EmbeddingModel

@Experimental public class GoogleGenAiEmbeddingModel extends DimensionAwareEmbeddingModel
  • Constructor Details

  • Method Details

    • embed

      public Response<Embedding> embed(TextSegment textSegment)
      Description copied from interface: EmbeddingModel
      Embed the text content of a TextSegment.
      Parameters:
      textSegment - the text segment to embed.
      Returns:
      the embedding.
    • embed

      public Response<Embedding> embed(String text)
      Description copied from interface: EmbeddingModel
      Embed a text.
      Parameters:
      text - the text to embed.
      Returns:
      the embedding.
    • embedAll

      public Response<List<Embedding>> embedAll(List<TextSegment> textSegments)
      Description copied from interface: EmbeddingModel
      Embeds the text content of a list of TextSegments.
      Parameters:
      textSegments - the text segments to embed.
      Returns:
      the embeddings.
    • modelName

      public String modelName()
      Description copied from interface: EmbeddingModel
      Returns the name of the underlying embedding model.

      Implementations are encouraged to override this method and provide the actual model name. The default implementation returns "unknown", which indicates that the model name is unknown.

      Returns:
      the model name or a fallback value if not provided
    • knownDimension

      public Integer knownDimension()
      Description copied from class: DimensionAwareEmbeddingModel
      When known (e.g., can be derived from the model name), returns the dimension of the Embedding produced by this embedding model. Otherwise, it returns null.
      Overrides:
      knownDimension in class DimensionAwareEmbeddingModel
      Returns:
      the known dimension of the Embedding, or null if unknown.
    • builder

      public static GoogleGenAiEmbeddingModel.Builder builder()