Class MiniMaxEmbeddingModel

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

public class MiniMaxEmbeddingModel extends AbstractEmbeddingModel
MiniMax Embedding Model implementation.
Since:
1.0.0 M1
Author:
Geng Rong, Thomas Vitale
  • Constructor Details

    • MiniMaxEmbeddingModel

      public MiniMaxEmbeddingModel(MiniMaxApi miniMaxApi)
      Constructor for the MiniMaxEmbeddingModel class.
      Parameters:
      miniMaxApi - The MiniMaxApi instance to use for making API requests.
    • MiniMaxEmbeddingModel

      public MiniMaxEmbeddingModel(MiniMaxApi miniMaxApi, MetadataMode metadataMode)
      Initializes a new instance of the MiniMaxEmbeddingModel class.
      Parameters:
      miniMaxApi - The MiniMaxApi instance to use for making API requests.
      metadataMode - The mode for generating metadata.
    • MiniMaxEmbeddingModel

      public MiniMaxEmbeddingModel(MiniMaxApi miniMaxApi, MetadataMode metadataMode, MiniMaxEmbeddingOptions miniMaxEmbeddingOptions)
      Initializes a new instance of the MiniMaxEmbeddingModel class.
      Parameters:
      miniMaxApi - The MiniMaxApi instance to use for making API requests.
      metadataMode - The mode for generating metadata.
      miniMaxEmbeddingOptions - The options for MiniMax embedding.
    • MiniMaxEmbeddingModel

      public MiniMaxEmbeddingModel(MiniMaxApi miniMaxApi, MetadataMode metadataMode, MiniMaxEmbeddingOptions miniMaxEmbeddingOptions, org.springframework.retry.support.RetryTemplate retryTemplate)
      Initializes a new instance of the MiniMaxEmbeddingModel class.
      Parameters:
      miniMaxApi - The MiniMaxApi instance to use for making API requests.
      metadataMode - The mode for generating metadata.
      miniMaxEmbeddingOptions - The options for MiniMax embedding.
      retryTemplate - - The RetryTemplate for retrying failed API requests.
    • MiniMaxEmbeddingModel

      public MiniMaxEmbeddingModel(MiniMaxApi miniMaxApi, MetadataMode metadataMode, MiniMaxEmbeddingOptions options, org.springframework.retry.support.RetryTemplate retryTemplate, io.micrometer.observation.ObservationRegistry observationRegistry)
      Initializes a new instance of the MiniMaxEmbeddingModel class.
      Parameters:
      miniMaxApi - - The MiniMaxApi instance to use for making API requests.
      metadataMode - - The mode for generating metadata.
      options - - The options for MiniMax embedding.
      retryTemplate - - The RetryTemplate for retrying failed API requests.
      observationRegistry - - The ObservationRegistry used for instrumentation.
  • 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 request)
      Description copied from interface: Model
      Executes a method call to the AI model.
      Parameters:
      request - the request object to be sent to the AI model
      Returns:
      the response from the AI model
    • setObservationConvention

      public void setObservationConvention(EmbeddingModelObservationConvention observationConvention)