pub struct PlannerContext {
pub available_actions: Vec<ActionMeta>,
pub history: Vec<HistoryItem>,
pub runtime_info: PlannerRuntimeInfo,
pub skill_instructions: Vec<SkillInstruction>,
pub skill_summaries: Vec<(String, String)>,
pub loop_context: Option<PlannerLoopContext>,
}Expand description
Context provided to the planner
Fields§
§available_actions: Vec<ActionMeta>Available actions and their metadata
history: Vec<HistoryItem>Conversation/interaction history
runtime_info: PlannerRuntimeInfoRuntime host information for platform-aware planning.
skill_instructions: Vec<SkillInstruction>Activated skill instructions for this planning turn (keyword-matched).
skill_summaries: Vec<(String, String)>All available skill names and descriptions for the planner catalog.
loop_context: Option<PlannerLoopContext>Observed execution state from prior planner iterations in the same turn.
Implementations§
Source§impl PlannerContext
impl PlannerContext
Sourcepub fn new(available_actions: Vec<ActionMeta>) -> PlannerContext
pub fn new(available_actions: Vec<ActionMeta>) -> PlannerContext
Create a new planner context
Sourcepub fn with_history(
available_actions: Vec<ActionMeta>,
history: Vec<HistoryItem>,
) -> PlannerContext
pub fn with_history( available_actions: Vec<ActionMeta>, history: Vec<HistoryItem>, ) -> PlannerContext
Create context with history
Sourcepub fn with_runtime_info(
self,
runtime_info: PlannerRuntimeInfo,
) -> PlannerContext
pub fn with_runtime_info( self, runtime_info: PlannerRuntimeInfo, ) -> PlannerContext
Attach runtime host information.
Sourcepub fn with_skill_instructions(
self,
skills: Vec<SkillInstruction>,
) -> PlannerContext
pub fn with_skill_instructions( self, skills: Vec<SkillInstruction>, ) -> PlannerContext
Attach matched skill instructions.
Sourcepub fn with_skill_summaries(
self,
summaries: Vec<(String, String)>,
) -> PlannerContext
pub fn with_skill_summaries( self, summaries: Vec<(String, String)>, ) -> PlannerContext
Attach all skill summaries for the planner catalog.
Sourcepub fn with_loop_context(
self,
loop_context: PlannerLoopContext,
) -> PlannerContext
pub fn with_loop_context( self, loop_context: PlannerLoopContext, ) -> PlannerContext
Attach agent-loop execution context from earlier iterations.
Sourcepub fn add_history(&mut self, item: HistoryItem)
pub fn add_history(&mut self, item: HistoryItem)
Add a history item
Sourcepub fn get_action(&self, name: &str) -> Option<&ActionMeta>
pub fn get_action(&self, name: &str) -> Option<&ActionMeta>
Get action by name
Auto Trait Implementations§
impl Freeze for PlannerContext
impl RefUnwindSafe for PlannerContext
impl Send for PlannerContext
impl Sync for PlannerContext
impl Unpin for PlannerContext
impl UnsafeUnpin for PlannerContext
impl UnwindSafe for PlannerContext
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more