PromptCondition class

Condition for a prompt.

The following pre-defined conditions are available:

Constructors

PromptCondition({required bool condition(BaseLanguageModel<Object, LanguageModelOptions, LanguageModelResult<Object>> llm), required BasePromptTemplate prompt})
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<Object>> llm)
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