Class BedrockCohereEmbeddingModel

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

public class BedrockCohereEmbeddingModel extends AbstractEmbeddingModel
EmbeddingModel implementation that uses the Bedrock Cohere Embedding API. Note: The invocation metrics are not exposed by AWS for this API. If this change in the future we will add it as metadata.
Since:
0.8.0
Author:
Christian Tzolov, Soby Chacko
  • 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