EmbeddingPurpose enum
What an embedding will be used for.
Several embedding models are asymmetric: they produce different vectors for the same text depending on whether it is a stored document or a search query, and using the wrong mode measurably degrades retrieval. Providers spell it differently — a task type, an input type, a prefix string — so the framework asks the question once, in provider-neutral terms, and lets adapters translate.
Getting this wrong is a silent failure: retrieval still returns results, they are simply worse. Which is why it is a required parameter with no default on the query side.
Values
- document → const EmbeddingPurpose
-
Text being stored for later retrieval.
- query → const EmbeddingPurpose
-
Text being used to search.
- similarity → const EmbeddingPurpose
-
Text being compared to other text of the same kind.
- clustering → const EmbeddingPurpose
-
Text being grouped.
- classification → const EmbeddingPurpose
-
Text being classified.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- index → int
-
A numeric identifier for the enumerated value.
no setterinherited
- name → String
-
Available on Enum, provided by the EnumName extension
The name of the enum value.no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
-
values
→ const List<
EmbeddingPurpose> - A constant List of the values in this enum, in order of their declaration.