Class AbstractBedrockEmbeddingModel<T extends BedrockEmbeddingResponse>
java.lang.Object
dev.langchain4j.model.bedrock.internal.AbstractBedrockEmbeddingModel<T>
- All Implemented Interfaces:
EmbeddingModel
- Direct Known Subclasses:
BedrockTitanEmbeddingModel
public abstract class AbstractBedrockEmbeddingModel<T extends BedrockEmbeddingResponse>
extends Object
implements EmbeddingModel
Abstract bedrock embedding model
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionembedAll
(List<TextSegment> textSegments) Embeds the text content of a list of TextSegments.protected abstract String
Get model idgetRequestParameters
(List<TextSegment> textSegments) Get request bodyGet response class typeprotected software.amazon.awssdk.services.bedrockruntime.model.InvokeModelResponse
Invoke modelCreate map with single entryMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface dev.langchain4j.model.embedding.EmbeddingModel
dimension, embed, embed
-
Constructor Details
-
AbstractBedrockEmbeddingModel
public AbstractBedrockEmbeddingModel()
-
-
Method Details
-
embedAll
Description copied from interface:EmbeddingModel
Embeds the text content of a list of TextSegments.- Specified by:
embedAll
in interfaceEmbeddingModel
- Parameters:
textSegments
- the text segments to embed.- Returns:
- the embeddings.
-
getRequestParameters
Get request body- Parameters:
textSegments
- Input texts to convert to embedding- Returns:
- request body
-
getModelId
Get model id- Returns:
- model id
-
getResponseClassType
Get response class type- Returns:
- response class type
-
invoke
protected software.amazon.awssdk.services.bedrockruntime.model.InvokeModelResponse invoke(String body) Invoke model- Parameters:
body
- body- Returns:
- invoke model response
-
of
Create map with single entry- Parameters:
key
- keyvalue
- value- Returns:
- map
-