AgentAction

Struct AgentAction 

Source
pub struct AgentAction {
Show 13 fields pub action_id: ActionId, pub agent_id: AgentId, pub step_id: Option<StepId>, pub action_type: ActionType, pub description: String, pub parameters: Option<Value>, pub retry_policy: Option<RetryPolicy>, pub timeout_ms: Option<i64>, pub status: ActionStatus, pub attempt_count: i32, pub created_at: Timestamp, pub started_at: Option<Timestamp>, pub completed_at: Option<Timestamp>,
}
Expand description

An action taken by an agent.

Fields§

§action_id: ActionId

Unique identifier for this action

§agent_id: AgentId

Agent performing this action

§step_id: Option<StepId>

Plan step this action is part of (if any)

§action_type: ActionType

Type of action

§description: String

Description of the action

§parameters: Option<Value>

Action parameters (JSON)

§retry_policy: Option<RetryPolicy>

Retry policy

§timeout_ms: Option<i64>

Timeout in milliseconds

§status: ActionStatus

Current status

§attempt_count: i32

Number of attempts made

§created_at: Timestamp

When this action was created

§started_at: Option<Timestamp>

When execution started

§completed_at: Option<Timestamp>

When completed

Implementations§

Source§

impl AgentAction

Source

pub fn new( agent_id: AgentId, action_type: ActionType, description: impl Into<String>, ) -> Self

Create a new action.

Source

pub fn with_step(self, step_id: StepId) -> Self

Set plan step.

Source

pub fn with_parameters(self, params: Value) -> Self

Set parameters.

Source

pub fn with_retry_policy(self, policy: RetryPolicy) -> Self

Set retry policy.

Source

pub fn with_timeout(self, timeout_ms: i64) -> Self

Set timeout.

Source

pub fn start(&mut self)

Start execution.

Source

pub fn complete(&mut self)

Mark as completed.

Source

pub fn fail(&mut self)

Mark as failed.

Source

pub fn can_retry(&self) -> bool

Check if retry is allowed.

Trait Implementations§

Source§

impl Clone for AgentAction

Source§

fn clone(&self) -> AgentAction

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl ComposeSchema for AgentAction

Source§

fn compose(generics: Vec<RefOr<Schema>>) -> RefOr<Schema>

Source§

impl Debug for AgentAction

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for AgentAction

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for AgentAction

Source§

fn eq(&self, other: &AgentAction) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for AgentAction

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl ToSchema for AgentAction

Source§

fn name() -> Cow<'static, str>

Return name of the schema. Read more
Source§

fn schemas(schemas: &mut Vec<(String, RefOr<Schema>)>)

Implement reference [utoipa::openapi::schema::Schema]s for this type. Read more
Source§

impl StructuralPartialEq for AgentAction

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> PartialSchema for T
where T: ComposeSchema + ?Sized,

§

fn schema() -> RefOr<Schema>

Return ref or schema of implementing type that can then be used to construct combined schemas.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,