Package dev.langchain4j.model.googleai
Class GoogleAiEmbeddingModel
java.lang.Object
dev.langchain4j.model.googleai.GoogleAiEmbeddingModel
- All Implemented Interfaces:
EmbeddingModel
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionGoogleAiEmbeddingModel
(String modelName, String apiKey, Integer maxRetries, GoogleAiEmbeddingModel.TaskType taskType, String titleMetadataKey, Integer outputDimensionality, Duration timeout, Boolean logRequestsAndResponses) -
Method Summary
Modifier and TypeMethodDescriptionint
Returns the dimension of theEmbedding
produced by this embedding model.embed
(TextSegment textSegment) Embed the text content of a TextSegment.Embed a text.embedAll
(List<TextSegment> textSegments) Embeds the text content of a list of TextSegments.
-
Constructor Details
-
GoogleAiEmbeddingModel
-
-
Method Details
-
embed
Description copied from interface:EmbeddingModel
Embed the text content of a TextSegment.- Specified by:
embed
in interfaceEmbeddingModel
- Parameters:
textSegment
- the text segment to embed.- Returns:
- the embedding.
-
embed
Description copied from interface:EmbeddingModel
Embed a text.- Specified by:
embed
in interfaceEmbeddingModel
- Parameters:
text
- the text to embed.- Returns:
- the embedding.
-
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.
-
dimension
public int dimension()Description copied from interface:EmbeddingModel
Returns the dimension of theEmbedding
produced by this embedding model.- Specified by:
dimension
in interfaceEmbeddingModel
- Returns:
- dimension of the embedding
-