ActionResult class represents the result of executing an action (tool). It provides structured output, error handling, and metadata for agent communication.
Constructor
Parameters
str | None
Main content to show to the agent. This is the primary output of the action.
str | None
Compact memory for long-term context. Used to summarize the action for future reference.
str | None
Error message if something went wrong. When set, this indicates the action failed.
bool
default:"False"
Whether the task is complete. Only used for the
done action.bool | None
Whether the task completed successfully. Can only be set when
is_done=True.list[str] | None
List of file paths to display in the completion message.
list[dict[str, Any]] | None
List of images (base64 encoded). Format:
[{"name": "file.jpg", "data": "base64_string"}]dict | None
Additional metadata for observability (e.g., click coordinates, duration, API calls).
JudgementResult | None
Judge evaluation result (populated by judge system).
bool
default:"False"
If
True, extracted content is only added to context once (for next step) and not stored in long-term memory.bool
default:"False"
Deprecated: Whether to include extracted content in long-term memory.
Return Formats
Tools can returnActionResult or simple strings: