AgentDecision class
The action decision produced by the LLM Core after reasoning.
The LLM may decide to:
- call a tool (AgentDecisionType.useTool)
- reason further (AgentDecisionType.think)
- declare the goal complete (AgentDecisionType.complete)
- request a re-plan (AgentDecisionType.replan)
- report a blocking error (AgentDecisionType.error)
Constructors
-
AgentDecision({required AgentDecisionType type, String? toolName, Map<
String, dynamic> ? toolInput, String? thought, String? replanReason, double confidence = 1.0, String? rawResponse}) -
const
- AgentDecision.complete(String reason, {double confidence = 1.0})
-
Convenience factory for a goal-complete signal.
factory
- AgentDecision.replan(String reason)
-
Convenience factory for a re-plan request.
factory
- AgentDecision.think(String thought, {double confidence = 0.8})
-
Convenience factory for a pure-thinking step.
factory
-
AgentDecision.useTool(String tool, Map<
String, dynamic> input, {String? thought, double confidence = 0.9}) -
Convenience factory for a tool-use decision.
factory
Properties
- confidence → double
-
How confident the LLM is in this decision.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- rawResponse → String?
-
Raw LLM response string before parsing.
final
- replanReason → String?
-
Explanation for why a re-plan is needed.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- thought → String?
-
The reasoning text the LLM produced.
final
-
toolInput
→ Map<
String, dynamic> ? -
Input arguments for the tool.
final
- toolName → String?
-
When type == AgentDecisionType.useTool, the tool to invoke.
final
- type → AgentDecisionType
-
The kind of action the agent decided to take.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited