Class BedrockTitanEmbeddingModel

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

public class BedrockTitanEmbeddingModel extends org.springframework.ai.embedding.AbstractEmbeddingModel
EmbeddingModel implementation that uses the Bedrock Titan Embedding API. Titan Embedding supports text and image (encoded in base64) inputs. Note: Titan Embedding does not support batch embedding.
Since:
0.8.0
Author:
Christian Tzolov, Wei Jiang
  • Constructor Details

    • BedrockTitanEmbeddingModel

      public BedrockTitanEmbeddingModel(TitanEmbeddingBedrockApi titanEmbeddingBedrockApi, io.micrometer.observation.ObservationRegistry observationRegistry)
  • Method Details

    • withInputType

      Titan Embedding API input types. Could be either text or image (encoded in base64).
      Parameters:
      inputType - the input type to use.
    • embed

      public float[] embed(org.springframework.ai.document.Document document)
    • call

      public org.springframework.ai.embedding.EmbeddingResponse call(org.springframework.ai.embedding.EmbeddingRequest request)
    • dimensions

      public int dimensions()
      Specified by:
      dimensions in interface org.springframework.ai.embedding.EmbeddingModel
      Overrides:
      dimensions in class org.springframework.ai.embedding.AbstractEmbeddingModel