Task
Defined in the task module.Rust AI Agent SDK A unit of work that can be executed by an Agent
Fields
| Name | Type | Description |
|---|---|---|
id | String | Unique task ID |
name | Option<String> | Task name (optional) |
description | String | Task description (what to do) |
expected_output | String | Expected output description |
status | TaskStatus | Task status |
task_type | TaskType | Task type |
result | Option<TaskOutput> | Task result |
depends_on | Vec<String> | Dependencies (task IDs or names) |
next_tasks | Vec<String> | Next tasks to execute |
condition | HashMap<String | Condition for routing (decision tasks) |
config | TaskConfig | Task configuration |
output_file | Option<String> | Output file path |
output_variable | Option<String> | Output variable name |
variables | HashMap<String | Variables for substitution |
serde_json | :Value> | Variables for substitution |
retry_count | u32 | Retry count |
is_start | bool | Is this the start task? |
Methods
new
| Name | Type |
|---|---|
description | impl Into<String> |
id
display_name
is_completed
is_failed
can_retry
increment_retry
set_result
| Name | Type |
|---|---|
output | TaskOutput |
set_failed
| Name | Type |
|---|---|
error | &str |
result_str
substitute_variables
| Name | Type |
|---|---|
context | &HashMap<String |
Source
View on GitHub
praisonai/src/task/mod.rs at line 186
