Class AzureOpenAiEmbeddingModel

java.lang.Object
org.springframework.ai.embedding.AbstractEmbeddingModel
org.springframework.ai.azure.openai.AzureOpenAiEmbeddingModel
All Implemented Interfaces:
EmbeddingModel, Model<EmbeddingRequest,EmbeddingResponse>

public class AzureOpenAiEmbeddingModel extends AbstractEmbeddingModel
Azure Open AI Embedding Model implementation.
Since:
1.0.0
Author:
Mark Pollack, Christian Tzolov, Thomas Vitale
  • Constructor Details

    • AzureOpenAiEmbeddingModel

      public AzureOpenAiEmbeddingModel(com.azure.ai.openai.OpenAIClient azureOpenAiClient)
    • AzureOpenAiEmbeddingModel

      public AzureOpenAiEmbeddingModel(com.azure.ai.openai.OpenAIClient azureOpenAiClient, MetadataMode metadataMode)
    • AzureOpenAiEmbeddingModel

      public AzureOpenAiEmbeddingModel(com.azure.ai.openai.OpenAIClient azureOpenAiClient, MetadataMode metadataMode, AzureOpenAiEmbeddingOptions options)
    • AzureOpenAiEmbeddingModel

      public AzureOpenAiEmbeddingModel(com.azure.ai.openai.OpenAIClient azureOpenAiClient, MetadataMode metadataMode, AzureOpenAiEmbeddingOptions options, io.micrometer.observation.ObservationRegistry observationRegistry)
  • Method Details

    • embed

      public float[] embed(Document document)
      Description copied from interface: EmbeddingModel
      Embeds the given document's content into a vector.
      Parameters:
      document - the document to embed.
      Returns:
      the embedded vector.
    • call

      public EmbeddingResponse call(EmbeddingRequest embeddingRequest)
      Description copied from interface: Model
      Executes a method call to the AI model.
      Parameters:
      embeddingRequest - the request object to be sent to the AI model
      Returns:
      the response from the AI model
    • getDefaultOptions

      public AzureOpenAiEmbeddingOptions getDefaultOptions()
    • setObservationConvention

      public void setObservationConvention(EmbeddingModelObservationConvention observationConvention)
      Use the provided convention for reporting observation data
      Parameters:
      observationConvention - The provided convention