pub struct LlmAgentBuilder { /* private fields */ }Expand description
Builder for LlmAgent – fluent API for declaring tools, middleware, sub-agents.
Implementations§
Source§impl LlmAgentBuilder
impl LlmAgentBuilder
Sourcepub fn tool(self, tool: impl ToolFunction + 'static) -> Self
pub fn tool(self, tool: impl ToolFunction + 'static) -> Self
Register a regular function tool.
Sourcepub fn typed_tool<T>(self, tool: TypedTool<T>) -> Self
pub fn typed_tool<T>(self, tool: TypedTool<T>) -> Self
Register a typed tool with auto-generated JSON Schema.
Sourcepub fn streaming_tool(self, tool: impl StreamingTool + 'static) -> Self
pub fn streaming_tool(self, tool: impl StreamingTool + 'static) -> Self
Register a streaming tool.
Sourcepub fn input_streaming_tool(
self,
tool: impl InputStreamingTool + 'static,
) -> Self
pub fn input_streaming_tool( self, tool: impl InputStreamingTool + 'static, ) -> Self
Register an input-streaming tool.
Sourcepub fn middleware(self, mw: impl Middleware + 'static) -> Self
pub fn middleware(self, mw: impl Middleware + 'static) -> Self
Add middleware to the agent.
Sourcepub fn sub_agent(self, agent: impl Agent + 'static) -> Self
pub fn sub_agent(self, agent: impl Agent + 'static) -> Self
Register a sub-agent (enables transfer_to_{name} tool).
Sourcepub fn tool_timeout(self, timeout: Duration) -> Self
pub fn tool_timeout(self, timeout: Duration) -> Self
Set the default timeout for tool execution.
Auto Trait Implementations§
impl !Freeze for LlmAgentBuilder
impl !RefUnwindSafe for LlmAgentBuilder
impl Send for LlmAgentBuilder
impl Sync for LlmAgentBuilder
impl Unpin for LlmAgentBuilder
impl !UnwindSafe for LlmAgentBuilder
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