Package dev.langchain4j.model.embedding
Interface EmbeddingModel
-
- All Implemented Interfaces:
public interface EmbeddingModel
Represents a model that can convert a given text into an embedding (vector representation of the text).
-
-
Method Summary
Modifier and Type Method Description Response<Embedding>
embed(String text)
Embed a text. Response<Embedding>
embed(TextSegment textSegment)
Embed the text content of a TextSegment. abstract Response<List<Embedding>>
embedAll(List<TextSegment> textSegments)
Embeds the text content of a list of TextSegments. int
dimension()
Returns the dimension of the Embedding produced by this embedding model. -
-
Method Detail
-
embed
Response<Embedding> embed(String text)
Embed a text.
- Parameters:
text
- the text to embed.- Returns:
the embedding.
-
embed
Response<Embedding> embed(TextSegment textSegment)
Embed the text content of a TextSegment.
- Parameters:
textSegment
- the text segment to embed.- Returns:
the embedding.
-
embedAll
abstract Response<List<Embedding>> embedAll(List<TextSegment> textSegments)
Embeds the text content of a list of TextSegments.
- Parameters:
textSegments
- the text segments to embed.- Returns:
the embeddings.
-
-
-
-