Interface EmbeddingFunction

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface EmbeddingFunction
Functional interface for computing text embeddings.

Implementations may delegate to a local model, remote API, or any other embedding provider. The returned array must be a fixed-dimension float vector suitable for cosine similarity.

  • Method Summary

    Modifier and Type
    Method
    Description
    float[]
    embed(String text)
    Computes an embedding vector for the given text.
  • Method Details

    • embed

      float[] embed(String text)
      Computes an embedding vector for the given text.
      Parameters:
      text - the text to embed
      Returns:
      a float array representing the embedding vector