ToolResult class
Result of executing a tool/action.
Constructors
-
ToolResult({required bool success, Map<
String, dynamic> data = const {}, String? error}) -
const
- ToolResult.fail(String error)
-
factory
-
ToolResult.ok([Map<
String, dynamic> data = const {}]) -
factory
Properties
-
data
→ Map<
String, dynamic> -
Data returned by the tool (varies per tool).
final
- error → String?
-
Error message if the tool failed.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- success → bool
-
Whether the tool execution succeeded.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toPromptString(
) → String - Format for LLM consumption as a tool result message.
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited