TaskOutput
Defined in the task module.Rust AI Agent SDK Task output containing the result of task execution
Fields
| Name | Type | Description |
|---|---|---|
raw | String | Raw output string |
json | Option<serde_json::Value> | Parsed JSON output (if applicable) |
task_id | String | Task ID |
agent_name | Option<String> | Agent name that executed the task |
duration_ms | Option<u64> | Execution duration in milliseconds |
tokens_used | Option<u32> | Token usage |
metadata | HashMap<String | Additional metadata |
serde_json | :Value> | Additional metadata |
Methods
new
| Name | Type |
|---|---|
raw | impl Into<String> |
task_id | impl Into<String> |
with_json
| Name | Type |
|---|---|
json | serde_json::Value |
with_agent
| Name | Type |
|---|---|
name | impl Into<String> |
with_duration
| Name | Type |
|---|---|
ms | u64 |
with_tokens
| Name | Type |
|---|---|
tokens | u32 |
with_metadata
| Name | Type |
|---|---|
key | impl Into<String> |
value | serde_json::Value |
as_str
parse_json
Source
View on GitHub
praisonai/src/task/mod.rs at line 28
