Package dev.langchain4j.model.googleai
Class GoogleAiEmbeddingModel
java.lang.Object
dev.langchain4j.model.embedding.DimensionAwareEmbeddingModel
dev.langchain4j.model.googleai.GoogleAiEmbeddingModel
- All Implemented Interfaces:
EmbeddingModel
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
static enum
-
Field Summary
Fields inherited from class dev.langchain4j.model.embedding.DimensionAwareEmbeddingModel
dimension
-
Constructor Summary
ConstructorsConstructorDescriptionGoogleAiEmbeddingModel
(String modelName, String apiKey, Integer maxRetries, GoogleAiEmbeddingModel.TaskType taskType, String titleMetadataKey, Integer outputDimensionality, Duration timeout, Boolean logRequestsAndResponses) -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
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.When known (e.g., can be derived from the model name), returns the dimension of theEmbedding
produced by this embedding model.Methods inherited from class dev.langchain4j.model.embedding.DimensionAwareEmbeddingModel
dimension
-
Constructor Details
-
GoogleAiEmbeddingModel
-
-
Method Details
-
builder
-
embed
Description copied from interface:EmbeddingModel
Embed the text content of a TextSegment.- Parameters:
textSegment
- the text segment to embed.- Returns:
- the embedding.
-
embed
Description copied from interface:EmbeddingModel
Embed a text.- Parameters:
text
- the text to embed.- Returns:
- the embedding.
-
embedAll
Description copied from interface:EmbeddingModel
Embeds the text content of a list of TextSegments.- Parameters:
textSegments
- the text segments to embed.- Returns:
- the embeddings.
-
knownDimension
Description copied from class:DimensionAwareEmbeddingModel
When known (e.g., can be derived from the model name), returns the dimension of theEmbedding
produced by this embedding model. Otherwise, it returnsnull
.- Overrides:
knownDimension
in classDimensionAwareEmbeddingModel
- Returns:
- the known dimension of the
Embedding
, ornull
if unknown.
-