pub struct Runner { /* private fields */ }Implementations§
Source§impl Runner
impl Runner
Sourcepub fn builder() -> RunnerConfigBuilder<NoAppName, NoAgent, NoSessionService>
pub fn builder() -> RunnerConfigBuilder<NoAppName, NoAgent, NoSessionService>
Create a typestate builder for constructing a Runner.
The builder enforces at compile time that the three required fields
(app_name, agent, session_service) are set before build() is
callable.
§Example
let runner = Runner::builder()
.app_name("my-app")
.agent(agent)
.session_service(session_service)
.build()?;pub fn new(config: RunnerConfig) -> Result<Self>
Sourcepub fn with_skill_injector(self, injector: SkillInjector) -> Self
pub fn with_skill_injector(self, injector: SkillInjector) -> Self
Enable skill injection using a pre-built injector.
Skill injection runs before plugin on_user_message callbacks.
Sourcepub fn with_auto_skills(
self,
root: impl AsRef<Path>,
config: SkillInjectorConfig,
) -> SkillResult<Self>
👎Deprecated: Use with_auto_skills_mut instead
pub fn with_auto_skills( self, root: impl AsRef<Path>, config: SkillInjectorConfig, ) -> SkillResult<Self>
Use with_auto_skills_mut instead
Enable skill injection by auto-loading .skills/ from the given root path.
Sourcepub fn with_auto_skills_mut(
&mut self,
root: impl AsRef<Path>,
config: SkillInjectorConfig,
) -> SkillResult<()>
pub fn with_auto_skills_mut( &mut self, root: impl AsRef<Path>, config: SkillInjectorConfig, ) -> SkillResult<()>
Enable skill injection by auto-loading .skills/ from the given root path.
Unlike with_auto_skills, this method borrows
the Runner mutably instead of consuming it. On error, the Runner remains
valid with no skill injector configured.
pub async fn run( &self, user_id: UserId, session_id: SessionId, user_content: Content, ) -> Result<EventStream>
Sourcepub async fn run_str(
&self,
user_id: &str,
session_id: &str,
user_content: Content,
) -> Result<EventStream>
pub async fn run_str( &self, user_id: &str, session_id: &str, user_content: Content, ) -> Result<EventStream>
Sourcepub fn find_agent_to_run(
root_agent: &Arc<dyn Agent>,
session: &dyn Session,
) -> Arc<dyn Agent>
pub fn find_agent_to_run( root_agent: &Arc<dyn Agent>, session: &dyn Session, ) -> Arc<dyn Agent>
Find which agent should handle the request based on session history
Sourcepub fn find_agent(
current: &Arc<dyn Agent>,
target_name: &str,
) -> Option<Arc<dyn Agent>>
pub fn find_agent( current: &Arc<dyn Agent>, target_name: &str, ) -> Option<Arc<dyn Agent>>
Recursively search agent tree for agent with given name
Sourcepub fn compute_transfer_context(
root: &Arc<dyn Agent>,
target_name: &str,
) -> (Option<String>, Vec<String>)
pub fn compute_transfer_context( root: &Arc<dyn Agent>, target_name: &str, ) -> (Option<String>, Vec<String>)
Compute the parent name and peer names for a given agent in the tree.
Returns (parent_name, peer_names).
Walks the agent tree to find the parent of target_name, then collects
the parent’s name and the sibling agent names (excluding the target itself).