pub struct ToolCallingAgent<C: LlmClient> { /* private fields */ }Expand description
Agent that uses native function calling.
Implementations§
Trait Implementations§
Source§impl<C: LlmClient> Agent for ToolCallingAgent<C>
impl<C: LlmClient> Agent for ToolCallingAgent<C>
Source§fn decide<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
messages: &'life1 [Message],
tools: &'life2 ToolRegistry,
) -> Pin<Box<dyn Future<Output = Result<Decision, AgentError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn decide<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
messages: &'life1 [Message],
tools: &'life2 ToolRegistry,
) -> Pin<Box<dyn Future<Output = Result<Decision, AgentError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Given messages and available tools, decide what to do next.
Source§fn prepare_context(&self, _ctx: &mut AgentContext, _messages: &[Message])
fn prepare_context(&self, _ctx: &mut AgentContext, _messages: &[Message])
Hook: modify context before each step. Default: no-op.
Source§fn prepare_tools(
&self,
_ctx: &AgentContext,
tools: &ToolRegistry,
) -> Vec<String>
fn prepare_tools( &self, _ctx: &AgentContext, tools: &ToolRegistry, ) -> Vec<String>
Hook: filter or reorder tools before each step.
Returns tool names to include. Default: all tools.
Source§fn after_action(&self, _ctx: &mut AgentContext, _tool_name: &str, _output: &str)
fn after_action(&self, _ctx: &mut AgentContext, _tool_name: &str, _output: &str)
Hook: called after tool execution with the tool name and output.
Can modify context or messages. Default: no-op.
Auto Trait Implementations§
impl<C> Freeze for ToolCallingAgent<C>where
C: Freeze,
impl<C> RefUnwindSafe for ToolCallingAgent<C>where
C: RefUnwindSafe,
impl<C> Send for ToolCallingAgent<C>
impl<C> Sync for ToolCallingAgent<C>
impl<C> Unpin for ToolCallingAgent<C>where
C: Unpin,
impl<C> UnsafeUnpin for ToolCallingAgent<C>where
C: UnsafeUnpin,
impl<C> UnwindSafe for ToolCallingAgent<C>where
C: UnwindSafe,
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