Struct AgentBuilder
pub struct AgentBuilder { /* private fields */ }Implementations§
Source§impl AgentBuilder
impl AgentBuilder
pub fn new() -> AgentBuilder
pub fn model_provider( self, model_provider: Box<dyn ModelProvider>, ) -> AgentBuilder
Sourcepub fn tools(self, tools: ScopedToolRegistry) -> AgentBuilder
pub fn tools(self, tools: ScopedToolRegistry) -> AgentBuilder
Set the agent’s sealed tool set. Production callers obtain the
crate::tools::scoped::ScopedToolRegistry from
ScopedToolRegistry::assemble(...) (the .registry field of its
output); raw Vec<Box<dyn Tool>> fixtures use
ScopedToolRegistry::from_raw_for_test, available to this crate’s unit
tests and, via the dev-only test-util feature, to other crates’ test
builds. Self::build applies the allowed_tools and ACP
memory-strip filters on top of the sealed set.
pub fn memory(self, memory: Arc<dyn Memory>) -> AgentBuilder
pub fn observer(self, observer: Arc<dyn Observer>) -> AgentBuilder
pub fn prompt_builder(self, prompt_builder: SystemPromptBuilder) -> AgentBuilder
pub fn tool_dispatcher( self, tool_dispatcher: Box<dyn ToolDispatcher>, ) -> AgentBuilder
Sourcepub fn memory_inject_cfg(self, cfg: MemoryInjectConfig) -> AgentBuilder
pub fn memory_inject_cfg(self, cfg: MemoryInjectConfig) -> AgentBuilder
Stable half of the engine’s memory-context injection policy. When unset, defaults preserve the legacy loader shape (recall limit 5, the schema-default relevance floor).
pub fn config(self, config: AliasedAgentConfig) -> AgentBuilder
pub fn multimodal_config( self, multimodal_config: MultimodalConfig, ) -> AgentBuilder
pub fn model_name(self, model_name: String) -> AgentBuilder
pub fn model_provider_name(self, name: String) -> AgentBuilder
pub fn temperature(self, temperature: Option<f64>) -> AgentBuilder
pub fn workspace_dir(self, workspace_dir: PathBuf) -> AgentBuilder
pub fn agent_workspace_dir(self, agent_workspace_dir: PathBuf) -> AgentBuilder
pub fn identity_config(self, identity_config: IdentityConfig) -> AgentBuilder
pub fn skills(self, skills: Vec<Skill>) -> AgentBuilder
pub fn skills_prompt_mode( self, skills_prompt_mode: SkillsPromptInjectionMode, ) -> AgentBuilder
pub fn auto_save(self, auto_save: bool) -> AgentBuilder
pub fn memory_session_id( self, memory_session_id: Option<String>, ) -> AgentBuilder
pub fn classification_config( self, classification_config: QueryClassificationConfig, ) -> AgentBuilder
pub fn available_hints(self, available_hints: Vec<String>) -> AgentBuilder
pub fn route_model_by_hint( self, route_model_by_hint: HashMap<String, String>, ) -> AgentBuilder
pub fn allowed_tools(self, allowed_tools: Option<Vec<String>>) -> AgentBuilder
pub fn response_cache(self, cache: Option<Arc<ResponseCache>>) -> AgentBuilder
pub fn security_summary(self, summary: Option<String>) -> AgentBuilder
pub fn autonomy_level(self, level: AutonomyLevel) -> AgentBuilder
Sourcepub fn shell_profile(self, profile: Option<ShellProfile>) -> AgentBuilder
pub fn shell_profile(self, profile: Option<ShellProfile>) -> AgentBuilder
Set the shell reported in the system prompt.
Pass RuntimeAdapter::shell_profile() from the same adapter the
agent’s tools were built with, so the prompt cannot name a shell other
than the one that will execute. Unset means no shell is reported.
pub fn approval_route(self, route: Option<ApprovalRoute>) -> AgentBuilder
pub fn activated_tools( self, activated: Option<Arc<Mutex<ActivatedToolSet>>>, ) -> AgentBuilder
pub fn mcp_pinned_section(self, section: Option<String>) -> AgentBuilder
pub fn mcp_deferred_section(self, section: Option<String>) -> AgentBuilder
pub fn hook_runner(self, runner: Option<Arc<HookRunner>>) -> AgentBuilder
pub fn approval_manager( self, manager: Option<Arc<ApprovalManager>>, ) -> AgentBuilder
Sourcepub fn agent_alias(self, alias: String) -> AgentBuilder
pub fn agent_alias(self, alias: String) -> AgentBuilder
Set the agent alias used for turn-span attribution.
pub fn channel_name(self, name: String) -> AgentBuilder
pub fn exclude_memory(self, exclude: bool) -> AgentBuilder
pub fn provider_switch_config(self, cfg: ProviderSwitchConfig) -> AgentBuilder
pub fn build(self) -> Result<Agent, Error>
Trait Implementations§
Source§impl Default for AgentBuilder
impl Default for AgentBuilder
Source§fn default() -> AgentBuilder
fn default() -> AgentBuilder
Auto Trait Implementations§
impl !RefUnwindSafe for AgentBuilder
impl !UnwindSafe for AgentBuilder
impl Freeze for AgentBuilder
impl Send for AgentBuilder
impl Sync for AgentBuilder
impl Unpin for AgentBuilder
impl UnsafeUnpin for AgentBuilder
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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>
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