Interface EmbeddingProvider

All Known Implementing Classes:
CodeMieProvider, OpenAIProvider

public interface EmbeddingProvider
EmbeddingProvider defines the contract for AI embedding providers.

Implementations of this interface are responsible for initializing with application configuration and generating embedding vectors for input text. Embeddings are typically used for tasks such as semantic search, similarity comparison, and natural language processing.

Example usage:

     EmbeddingProvider provider = ...;
     provider.init(configurator);
     List<Double> vector = provider.embedding("example text", 384);
 
Since:
1.1.14
Author:
Viktor Tovstyi
  • Method Summary

    Modifier and Type
    Method
    Description
    embedding(String text, long dimensions)
    Computes an embedding vector for the provided text.
    void
    init(String model, Configurator conf)
    Initializes the provider with application configuration.
  • Method Details

    • init

      void init(String model, Configurator conf)
      Initializes the provider with application configuration.
      Parameters:
      model - model identifier to use
      conf - configuration source
    • embedding

      List<Double> embedding(String text, long dimensions)
      Computes an embedding vector for the provided text.
      Parameters:
      text - the input text
      dimensions - desired embedding dimensionality (provider-specific)
      Returns:
      the embedding vector