Class BedrockTitanEmbeddingClient
java.lang.Object
org.springframework.ai.embedding.AbstractEmbeddingClient
org.springframework.ai.bedrock.titan.BedrockTitanEmbeddingClient
- All Implemented Interfaces:
EmbeddingClient
,ModelClient<EmbeddingRequest,
EmbeddingResponse>
EmbeddingClient
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
-
Nested Class Summary
-
Field Summary
Fields inherited from class org.springframework.ai.embedding.AbstractEmbeddingClient
embeddingDimensions
-
Constructor Summary
ConstructorDescriptionBedrockTitanEmbeddingClient
(TitanEmbeddingBedrockApi titanEmbeddingBedrockApi) -
Method Summary
Modifier and TypeMethodDescriptioncall
(EmbeddingRequest request) Executes a method call to the AI model.int
Embeds the given document's content into a vector.Titan Embedding API input types.Methods inherited from class org.springframework.ai.embedding.AbstractEmbeddingClient
dimensions
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.ai.embedding.EmbeddingClient
embed, embed, embedForResponse
-
Constructor Details
-
BedrockTitanEmbeddingClient
-
-
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
Description copied from interface:EmbeddingClient
Embeds the given document's content into a vector.- Parameters:
document
- the document to embed.- Returns:
- the embedded vector.
-
call
Description copied from interface:ModelClient
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
-
dimensions
public int dimensions()- Specified by:
dimensions
in interfaceEmbeddingClient
- Overrides:
dimensions
in classAbstractEmbeddingClient
- Returns:
- the number of dimensions of the embedded vectors. It is generative specific.
-