PromptCondition class
Condition for a prompt.
The following pre-defined conditions are available:
- PromptCondition.isLlm: checks that the language model is an LLM.
- PromptCondition.isChatModel: checks that the language model is a chat model.
Constructors
-
PromptCondition({required bool condition(BaseLanguageModel<
Object, LanguageModelOptions, LanguageModelResult< llm), required BasePromptTemplate prompt})Object> > -
Condition for a prompt.
const
- PromptCondition.isChatModel(BasePromptTemplate prompt)
-
A prompt for a language mode that is a chat model.
factory
- PromptCondition.isLlm(BasePromptTemplate prompt)
-
A prompt for a language mode that is an LLM.
factory
Properties
-
condition
→ bool Function(BaseLanguageModel<
Object, LanguageModelOptions, LanguageModelResult< llm)Object> > -
Condition for a prompt.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- prompt → BasePromptTemplate
-
Prompt to use if the condition is met.
final
- 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