AgentGoal

Struct AgentGoal 

Source
pub struct AgentGoal {
Show 15 fields pub goal_id: GoalId, pub agent_id: AgentId, pub trajectory_id: Option<TrajectoryId>, pub description: String, pub goal_type: GoalType, pub status: GoalStatus, pub success_criteria: Vec<SuccessCriterion>, pub priority: i32, pub deadline: Option<Timestamp>, pub parent_goal_id: Option<GoalId>, pub child_goal_ids: Vec<GoalId>, pub created_at: Timestamp, pub started_at: Option<Timestamp>, pub completed_at: Option<Timestamp>, pub failure_reason: Option<String>,
}
Expand description

A goal that an agent is pursuing.

Fields§

§goal_id: GoalId

Unique identifier for this goal

§agent_id: AgentId

Agent pursuing this goal

§trajectory_id: Option<TrajectoryId>

Trajectory this goal belongs to (if any)

§description: String

Description of the goal

§goal_type: GoalType

Type of goal

§status: GoalStatus

Current status

§success_criteria: Vec<SuccessCriterion>

Criteria for success

§priority: i32

Priority (higher = more important)

§deadline: Option<Timestamp>

Deadline (if any)

§parent_goal_id: Option<GoalId>

Parent goal (for subgoals)

§child_goal_ids: Vec<GoalId>

Child goals (subgoals)

§created_at: Timestamp

When this goal was created

§started_at: Option<Timestamp>

When work started

§completed_at: Option<Timestamp>

When completed

§failure_reason: Option<String>

Reason for failure (if failed)

Implementations§

Source§

impl AgentGoal

Source

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

Create a new goal.

Source

pub fn with_trajectory(self, trajectory_id: TrajectoryId) -> Self

Set trajectory.

Source

pub fn with_parent(self, parent_id: GoalId) -> Self

Set parent goal.

Source

pub fn with_criterion(self, criterion: SuccessCriterion) -> Self

Add a success criterion.

Source

pub fn with_priority(self, priority: i32) -> Self

Set priority.

Source

pub fn with_deadline(self, deadline: Timestamp) -> Self

Set deadline.

Source

pub fn start(&mut self)

Start pursuing this goal.

Source

pub fn achieve(&mut self)

Mark as achieved.

Source

pub fn fail(&mut self, reason: impl Into<String>)

Mark as failed.

Source

pub fn all_criteria_satisfied(&self) -> bool

Check if all criteria are satisfied.

Trait Implementations§

Source§

impl Clone for AgentGoal

Source§

fn clone(&self) -> AgentGoal

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 AgentGoal

Source§

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

Source§

impl Debug for AgentGoal

Source§

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

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

impl<'de> Deserialize<'de> for AgentGoal

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 AgentGoal

Source§

fn eq(&self, other: &AgentGoal) -> 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 AgentGoal

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 AgentGoal

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 AgentGoal

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>,