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 classstatic enum -
Field Summary
Fields inherited from class DimensionAwareEmbeddingModel
dimension -
Constructor Summary
ConstructorsConstructorDescription -
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 theEmbeddingproduced by this embedding model.Returns the name of the underlying embedding model.Methods inherited from class DimensionAwareEmbeddingModel
dimension
-
Constructor Details
-
GoogleAiEmbeddingModel
-
-
Method Details
-
builder
-
embed
Description copied from interface:EmbeddingModelEmbed the text content of a TextSegment.- Parameters:
textSegment- the text segment to embed.- Returns:
- the embedding.
-
embed
Description copied from interface:EmbeddingModelEmbed a text.- Parameters:
text- the text to embed.- Returns:
- the embedding.
-
embedAll
Description copied from interface:EmbeddingModelEmbeds the text content of a list of TextSegments.- Parameters:
textSegments- the text segments to embed.- Returns:
- the embeddings.
-
modelName
Description copied from interface:EmbeddingModelReturns the name of the underlying embedding model.Implementations are encouraged to override this method and provide the actual model name. The default implementation returns
"unknown", which indicates that the model name is unknown.- Returns:
- the model name or a fallback value if not provided
-
knownDimension
Description copied from class:DimensionAwareEmbeddingModelWhen known (e.g., can be derived from the model name), returns the dimension of theEmbeddingproduced by this embedding model. Otherwise, it returnsnull.- Overrides:
knownDimensionin classDimensionAwareEmbeddingModel- Returns:
- the known dimension of the
Embedding, ornullif unknown.
-