pub struct AgentContext { /* private fields */ }Expand description
Agent context information.
Manages all context-related information that influences agent behavior. This includes project overview, memory, skills, and system prompts.
Implementations§
Source§impl AgentContext
impl AgentContext
Sourcepub fn new(profile: PromptProfile) -> Self
pub fn new(profile: PromptProfile) -> Self
Create a new context with given profile.
Sourcepub fn with_context(
profile: PromptProfile,
skills: Vec<Skill>,
project_overview: Option<String>,
memory_summary: Option<String>,
project_path: Option<PathBuf>,
) -> Self
pub fn with_context( profile: PromptProfile, skills: Vec<Skill>, project_overview: Option<String>, memory_summary: Option<String>, project_path: Option<PathBuf>, ) -> Self
Create a new context with skills and overview.
Sourcepub fn set_skills(&mut self, skills: Vec<Skill>)
pub fn set_skills(&mut self, skills: Vec<Skill>)
Set skills (rebuilds system prompt).
Sourcepub fn project_overview(&self) -> Option<&str>
pub fn project_overview(&self) -> Option<&str>
Get project overview.
Sourcepub fn set_project_overview(&mut self, overview: Option<String>)
pub fn set_project_overview(&mut self, overview: Option<String>)
Set project overview (rebuilds system prompt).
Sourcepub fn memory_summary(&self) -> Option<&str>
pub fn memory_summary(&self) -> Option<&str>
Get memory summary.
Sourcepub fn update_memory(&mut self, summary: Option<String>)
pub fn update_memory(&mut self, summary: Option<String>)
Update memory summary (rebuilds system prompt).
Sourcepub fn project_path(&self) -> Option<&PathBuf>
pub fn project_path(&self) -> Option<&PathBuf>
Get project path.
Sourcepub fn set_project_path(&mut self, path: Option<PathBuf>)
pub fn set_project_path(&mut self, path: Option<PathBuf>)
Set project path (may trigger CodeGraph injection).
Sourcepub fn system_prompt(&self) -> &str
pub fn system_prompt(&self) -> &str
Get system prompt.
Sourcepub fn profile(&self) -> &PromptProfile
pub fn profile(&self) -> &PromptProfile
Get prompt profile.
Sourcepub fn set_system_prompt(&mut self, prompt: String)
pub fn set_system_prompt(&mut self, prompt: String)
Set system prompt directly (for workflows with project_path).
Sourcepub fn rebuild_system_prompt_with_workflows(
&mut self,
project_path: Option<PathBuf>,
)
pub fn rebuild_system_prompt_with_workflows( &mut self, project_path: Option<PathBuf>, )
Rebuild system prompt with workflows (includes project_path for CodeGraph).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AgentContext
impl RefUnwindSafe for AgentContext
impl Send for AgentContext
impl Sync for AgentContext
impl Unpin for AgentContext
impl UnsafeUnpin for AgentContext
impl UnwindSafe for AgentContext
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