pub struct AgentAction {Show 13 fields
pub id: Uuid,
pub action_type: AgentActionType,
pub name: String,
pub arguments: Option<String>,
pub result: Option<String>,
pub duration_ms: Option<u64>,
pub success: bool,
pub exit_code: Option<i32>,
pub http_method: Option<String>,
pub http_status: Option<u16>,
pub file_operation: Option<String>,
pub timestamp: DateTime<Utc>,
pub metadata: HashMap<String, String>,
}Expand description
A single agent action captured during or after an LLM interaction.
Fields§
§id: UuidUnique identifier for this action.
action_type: AgentActionTypeType of action.
name: StringName of the tool, skill, command, URL, or file path.
arguments: Option<String>Arguments or parameters (JSON-encoded for tool calls, raw string otherwise).
result: Option<String>Result or output of the action (truncated to AGENT_ACTION_RESULT_MAX_BYTES).
duration_ms: Option<u64>Duration of the action in milliseconds.
success: boolWhether the action succeeded.
exit_code: Option<i32>Exit code (for command executions).
http_method: Option<String>HTTP method (for web access).
http_status: Option<u16>HTTP status code (for web access).
file_operation: Option<String>File operation type: “read”, “write”, “delete” (for file access).
timestamp: DateTime<Utc>When the action occurred.
metadata: HashMap<String, String>Additional metadata.
Implementations§
Source§impl AgentAction
impl AgentAction
Sourcepub fn new(action_type: AgentActionType, name: String) -> Self
pub fn new(action_type: AgentActionType, name: String) -> Self
Create a new agent action.
Sourcepub fn with_arguments(self, arguments: String) -> Self
pub fn with_arguments(self, arguments: String) -> Self
Set the arguments for this action.
Sourcepub fn with_result(self, result: String) -> Self
pub fn with_result(self, result: String) -> Self
Set the result, truncating to AGENT_ACTION_RESULT_MAX_BYTES.
Sourcepub fn with_duration_ms(self, ms: u64) -> Self
pub fn with_duration_ms(self, ms: u64) -> Self
Set the duration in milliseconds.
Sourcepub fn with_failure(self) -> Self
pub fn with_failure(self) -> Self
Mark the action as failed.
Sourcepub fn with_exit_code(self, code: i32) -> Self
pub fn with_exit_code(self, code: i32) -> Self
Set the exit code (for command executions).
Sourcepub fn with_http(self, method: String, status: u16) -> Self
pub fn with_http(self, method: String, status: u16) -> Self
Set HTTP method and status (for web access).
Sourcepub fn with_file_operation(self, op: String) -> Self
pub fn with_file_operation(self, op: String) -> Self
Set the file operation type (for file access).
Sourcepub fn with_metadata(self, key: String, value: String) -> Self
pub fn with_metadata(self, key: String, value: String) -> Self
Add metadata to this action.
Trait Implementations§
Source§impl Clone for AgentAction
impl Clone for AgentAction
Source§fn clone(&self) -> AgentAction
fn clone(&self) -> AgentAction
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more