Documentation Index
Fetch the complete documentation index at: https://docs.praison.ai/llms.txt
Use this file to discover all available pages before exploring further.
TaskBuilder
Defined in the task module.
Rust AI Agent SDK
Builder for Task
Fields
| Name | Type | Description |
|---|
description | String | - |
name | Option<String> | - |
expected_output | String | - |
depends_on | Vec<String> | - |
next_tasks | Vec<String> | - |
condition | HashMap<String | - |
config | TaskConfig | - |
output_file | Option<String> | - |
output_variable | Option<String> | - |
variables | HashMap<String | - |
serde_json | :Value> | - |
task_type | TaskType | - |
is_start | bool | - |
Methods
new
fn new(description: impl Into<String>) -> Self
Create a new task builder
Parameters:
| Name | Type |
|---|
description | impl Into<String> |
name
fn name(mut self, name: impl Into<String>) -> Self
Set task name
Parameters:
| Name | Type |
|---|
name | impl Into<String> |
expected_output
fn expected_output(mut self, output: impl Into<String>) -> Self
Set expected output
Parameters:
| Name | Type |
|---|
output | impl Into<String> |
depends_on
fn depends_on(mut self, task: impl Into<String>) -> Self
Add dependency
Parameters:
| Name | Type |
|---|
task | impl Into<String> |
next_task
fn next_task(mut self, task: impl Into<String>) -> Self
Add next task
Parameters:
| Name | Type |
|---|
task | impl Into<String> |
task_type
fn task_type(mut self, task_type: TaskType) -> Self
Set task type
Parameters:
| Name | Type |
|---|
task_type | TaskType |
decision
fn decision(mut self) -> Self
Set as decision task
loop_task
fn loop_task(mut self) -> Self
Set as loop task
output_file
fn output_file(mut self, path: impl Into<String>) -> Self
Set output file
Parameters:
| Name | Type |
|---|
path | impl Into<String> |
output_variable
fn output_variable(mut self, name: impl Into<String>) -> Self
Set output variable
Parameters:
| Name | Type |
|---|
name | impl Into<String> |
variable
fn variable(mut self, key: impl Into<String>, value: serde_json::Value) -> Self
Add variable
Parameters:
| Name | Type |
|---|
key | impl Into<String> |
value | serde_json::Value |
max_retries
fn max_retries(mut self, retries: u32) -> Self
Set max retries
Parameters:
on_error
fn on_error(mut self, behavior: OnError) -> Self
Set error handling
Parameters:
is_start
fn is_start(mut self, is_start: bool) -> Self
Set as start task
Parameters:
build
Build the task
Source
View on GitHub
praisonai/src/task/mod.rs at line 319