pub struct AgentBuilder { /* private fields */ }Implementations§
Source§impl AgentBuilder
impl AgentBuilder
pub fn new(client: Arc<dyn LlmClient>) -> AgentBuilder
pub fn event_bus_capacity(self, capacity: usize) -> AgentBuilder
pub fn session_id_generator( self, generator: Arc<dyn SessionIdGenerator>, ) -> AgentBuilder
pub fn system_prompt(self, system_prompt: impl Into<String>) -> AgentBuilder
Sourcepub fn enable_thought(self, enable: bool) -> AgentBuilder
pub fn enable_thought(self, enable: bool) -> AgentBuilder
Set whether to include the reasoning content in LLM responses.
Controls whether the reasoning_content field from the LLM is forwarded
to consumers (i.e., “show the thinking process”).
See AgentConfig::enable_thought for the distinction from enable_thinking().
pub fn reasoning(self, config: ReasoningConfig) -> AgentBuilder
Sourcepub fn enable_thinking(self, enable: bool) -> AgentBuilder
pub fn enable_thinking(self, enable: bool) -> AgentBuilder
Set whether to enable the model’s extended thinking / reasoning mode.
Controls whether the model performs deep reasoning (i.e., “enable thinking mode”).
See AgentConfig::enable_thought for the distinction from enable_thought().
pub fn thinking_budget(self, budget: u64) -> AgentBuilder
pub fn tool_timeout(self, timeout_ms: u64) -> AgentBuilder
pub fn max_tool_output_chars(self, max_chars: usize) -> AgentBuilder
pub fn register_tool(self, tool: impl Tool + 'static) -> AgentBuilder
pub fn register_tool_arc(self, tool: Arc<dyn Tool>) -> AgentBuilder
pub fn approval_handler(self, handler: Arc<dyn ApprovalHandler>) -> AgentBuilder
pub fn tool_policy(self, policy: Arc<dyn ToolPolicy>) -> AgentBuilder
pub fn middleware(self, mw: impl Middleware + 'static) -> AgentBuilder
pub fn context_window(self, max_tokens: usize) -> AgentBuilder
pub fn context_window_manager( self, manager: ContextWindowManager, ) -> AgentBuilder
pub fn response_format(self, format: ResponseFormat) -> AgentBuilder
pub fn llm_retry(self, retry: RetryConfig) -> AgentBuilder
pub fn session_store(self, store: Arc<dyn SessionStore>) -> AgentBuilder
pub fn error_recovery( self, recovery: Arc<dyn ToolErrorRecovery>, ) -> AgentBuilder
pub fn max_sessions(self, max: usize) -> AgentBuilder
pub fn max_turns_per_session(self, max: usize) -> AgentBuilder
pub fn max_message_tokens(self, max: usize) -> AgentBuilder
pub fn tool_error_retry_prompt(self, prompt: impl Into<String>) -> AgentBuilder
pub fn language(self, language: Language) -> AgentBuilder
Sourcepub fn apply_if<T>(
self,
value: Option<T>,
f: impl FnOnce(AgentBuilder, T) -> AgentBuilder,
) -> AgentBuilder
pub fn apply_if<T>( self, value: Option<T>, f: impl FnOnce(AgentBuilder, T) -> AgentBuilder, ) -> AgentBuilder
pub fn build(self) -> Result<AgentRuntime, AgentError>
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§
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