Class EmbeddingInput
java.lang.Object
dev.langchain4j.model.embedding.request.EmbeddingInput
A single input to embed: one or more ordered
Content parts that are fused into one
Embedding.
A plain text input is simply a single TextContent. Multimodal models can accept an interleaving of
text and image/video/audio parts (e.g. Cohere Embed v4, Voyage multimodal) — the whole interleaved list
produces a single vector.
An EmbeddingRequest carries a list of EmbeddingInputs (the batch dimension), each of
which carries a list of Content parts (the interleaving dimension).
- Since:
- 1.18.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncontents()The ordered content parts that together produce a single embedding.The set ofContentTypes present in this input.booleanstatic EmbeddingInputstatic EmbeddingInputfrom(TextSegment segment) static EmbeddingInputstatic EmbeddingInputinthashCode()text()The text of allTextContentparts of this input, used by text-only models.toString()
-
Constructor Details
-
EmbeddingInput
-
-
Method Details
-
contents
-
contentTypes
The set ofContentTypes present in this input. AnEmbeddingModelvalidates these against itssupported content types. -
text
The text of allTextContentparts of this input, used by text-only models. For a plain single-text input this is just its text; when there are multiple text parts, they are joined with a newline. -
from
-
from
-
from
-
from
-
equals
-
hashCode
-
toString
-