pub struct LlmCallable { /* private fields */ }Expand description
LLM-powered callable with tool execution
This is the “agentic” callable - it runs the LLM in a loop, executing tools as requested until a final response is produced.
Note: The loop is controlled by max_iterations to prevent runaway.
Implementations§
Source§impl LlmCallable
impl LlmCallable
Sourcepub fn with_provider(
name: impl Into<String>,
system_prompt: impl Into<String>,
provider: Arc<dyn ModelProvider>,
) -> Self
pub fn with_provider( name: impl Into<String>, system_prompt: impl Into<String>, provider: Arc<dyn ModelProvider>, ) -> Self
Create with a custom provider
Sourcepub fn with_emitter(self, emitter: Arc<EventEmitter>) -> Self
pub fn with_emitter(self, emitter: Arc<EventEmitter>) -> Self
Set the event emitter for streaming tool events
Sourcepub fn with_model(self, model: impl Into<String>) -> Self
pub fn with_model(self, model: impl Into<String>) -> Self
Pin a logical model id for this callable.
Sourcepub fn with_routing_policy(self, policy: RoutingPolicy) -> Self
pub fn with_routing_policy(self, policy: RoutingPolicy) -> Self
Override routing policy for this callable.
pub fn with_description(self, description: impl Into<String>) -> Self
Sourcepub fn max_iterations(self, max: usize) -> Self
pub fn max_iterations(self, max: usize) -> Self
Set max iterations for tool loop
Trait Implementations§
Source§impl Callable for LlmCallable
impl Callable for LlmCallable
Source§fn description(&self) -> Option<&str>
fn description(&self) -> Option<&str>
Callable description (optional, for documentation)
Source§fn run_streaming<'life0, 'life1, 'async_trait>(
&'life0 self,
input: &'life1 str,
event_tx: Sender<StreamEvent>,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn run_streaming<'life0, 'life1, 'async_trait>(
&'life0 self,
input: &'life1 str,
event_tx: Sender<StreamEvent>,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Execute with streaming events forwarded to the given sender. Read more
Source§fn run<'life0, 'life1, 'async_trait>(
&'life0 self,
input: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn run<'life0, 'life1, 'async_trait>(
&'life0 self,
input: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Execute the callable with the given input Read more
Source§fn last_usage(&self) -> Option<LlmTokenUsage>
fn last_usage(&self) -> Option<LlmTokenUsage>
Token usage from the last successful run, if available. Read more
Auto Trait Implementations§
impl !Freeze for LlmCallable
impl !RefUnwindSafe for LlmCallable
impl Send for LlmCallable
impl Sync for LlmCallable
impl Unpin for LlmCallable
impl UnsafeUnpin for LlmCallable
impl !UnwindSafe for LlmCallable
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