Class WatsonxAiEmbeddingModel

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

public class WatsonxAiEmbeddingModel extends AbstractEmbeddingModel
EmbeddingModel implementation for Watsonx.ai.

Watsonx.ai allows developers to run large language models and generate embeddings. It supports open-source models available on Watsonx.ai models.

Please refer to the official Watsonx.ai website for the most up-to-date information on available models.

Since:
1.0.0
Author:
Pablo Sanchidrian Herrera
  • Constructor Details

  • 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