ResponseLanguage enum
The language the AI should use in its response.
Pass this to Prompt to control which language the model writes in. auto is the smart default — the model detects the user's language from their message and replies in the same language.
Prompt(
language: ResponseLanguage.auto, // matches whatever the user writes
)
For language detection logic, see MessageAnalyzer.
Values
- english → const ResponseLanguage
-
Respond only in English, regardless of the user's message language.
- arabic → const ResponseLanguage
-
Respond only in Arabic (Modern Standard or dialect, depending on context).
Works well for Egyptian Arabic apps — the model respects colloquial phrasing when the system prompt uses Arabic examples.
- bilingual → const ResponseLanguage
-
Respond in both English and Arabic side by side.
Useful for language-learning apps or mixed-audience products where users may be more comfortable in either language.
- auto → const ResponseLanguage
-
Detect the user's language automatically and reply in the same language.
This is the recommended default. MessageAnalyzer detects whether the message is Arabic, English, or mixed, and Prompt.build injects the matching language instruction.
Arabic detection uses the Unicode range –ۿ. If both scripts appear, bilingual behavior applies.
Properties
- compressed → String
-
Short token-compressed label used in the telegraphic system prompt.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- index → int
-
A numeric identifier for the enumerated value.
no setterinherited
- instruction → String
-
The natural-language instruction injected into the system prompt.
no setter
- 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<
ResponseLanguage> - A constant List of the values in this enum, in order of their declaration.