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: GoalIdUnique identifier for this goal
agent_id: AgentIdAgent pursuing this goal
trajectory_id: Option<TrajectoryId>Trajectory this goal belongs to (if any)
description: StringDescription of the goal
goal_type: GoalTypeType of goal
status: GoalStatusCurrent status
success_criteria: Vec<SuccessCriterion>Criteria for success
priority: i32Priority (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: TimestampWhen 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
impl AgentGoal
Sourcepub fn new(
agent_id: AgentId,
description: impl Into<String>,
goal_type: GoalType,
) -> Self
pub fn new( agent_id: AgentId, description: impl Into<String>, goal_type: GoalType, ) -> Self
Create a new goal.
Sourcepub fn with_trajectory(self, trajectory_id: TrajectoryId) -> Self
pub fn with_trajectory(self, trajectory_id: TrajectoryId) -> Self
Set trajectory.
Sourcepub fn with_parent(self, parent_id: GoalId) -> Self
pub fn with_parent(self, parent_id: GoalId) -> Self
Set parent goal.
Sourcepub fn with_criterion(self, criterion: SuccessCriterion) -> Self
pub fn with_criterion(self, criterion: SuccessCriterion) -> Self
Add a success criterion.
Sourcepub fn with_priority(self, priority: i32) -> Self
pub fn with_priority(self, priority: i32) -> Self
Set priority.
Sourcepub fn with_deadline(self, deadline: Timestamp) -> Self
pub fn with_deadline(self, deadline: Timestamp) -> Self
Set deadline.
Sourcepub fn all_criteria_satisfied(&self) -> bool
pub fn all_criteria_satisfied(&self) -> bool
Check if all criteria are satisfied.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for AgentGoal
impl<'de> Deserialize<'de> for AgentGoal
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for AgentGoal
Auto Trait Implementations§
impl Freeze for AgentGoal
impl RefUnwindSafe for AgentGoal
impl Send for AgentGoal
impl Sync for AgentGoal
impl Unpin for AgentGoal
impl UnwindSafe for AgentGoal
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more