Package dev.langchain4j.model.embedding
Interface EmbeddingModel
- All Known Implementing Classes:
AbstractBedrockEmbeddingModel
,AzureOpenAiEmbeddingModel
,BedrockTitanEmbeddingModel
,CohereEmbeddingModel
,DimensionAwareEmbeddingModel
,DisabledEmbeddingModel
,GitHubModelsEmbeddingModel
,GoogleAiEmbeddingModel
,HuggingFaceEmbeddingModel
,JinaEmbeddingModel
,JlamaEmbeddingModel
,LocalAiEmbeddingModel
,MistralAiEmbeddingModel
,NomicEmbeddingModel
,OllamaEmbeddingModel
,OpenAiEmbeddingModel
,OvhAiEmbeddingModel
,QianfanEmbeddingModel
,QwenEmbeddingModel
,VertexAiEmbeddingModel
,VoyageAiEmbeddingModel
,WorkersAiEmbeddingModel
,ZhipuAiEmbeddingModel
public interface EmbeddingModel
Represents a model that can convert a given text into an embedding (vector representation of the text).
-
Method Summary
Modifier and TypeMethodDescriptiondefault int
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.
-
Method Details
-
embed
Embed a text.- Parameters:
text
- the text to embed.- Returns:
- the embedding.
-
embed
Embed the text content of a TextSegment.- Parameters:
textSegment
- the text segment to embed.- Returns:
- the embedding.
-
embedAll
Embeds the text content of a list of TextSegments.- Parameters:
textSegments
- the text segments to embed.- Returns:
- the embeddings.
-
dimension
default int dimension()Returns the dimension of theEmbedding
produced by this embedding model.- Returns:
- dimension of the embedding
-