pub struct GraphCallable { /* private fields */ }Expand description
A callable backed by a compiled graph
This wrapper allows CompiledGraph to be used as a Callable, enabling
graphs to be registered in the CallableRegistry and executed through
the unified agent/stream endpoint.
Implementations§
Source§impl GraphCallable
impl GraphCallable
Sourcepub fn new(name: impl Into<String>, graph: Arc<CompiledGraph>) -> Self
pub fn new(name: impl Into<String>, graph: Arc<CompiledGraph>) -> Self
Create a new GraphCallable
§Arguments
name- The name of this callablegraph- The compiled graph to wrap
Sourcepub fn graph(&self) -> &CompiledGraph
pub fn graph(&self) -> &CompiledGraph
Get a reference to the underlying graph
Trait Implementations§
Source§impl Callable for GraphCallable
impl Callable for GraphCallable
Source§fn description(&self) -> Option<&str>
fn description(&self) -> Option<&str>
Callable description (optional, for documentation)
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 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 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 GraphCallable
impl !RefUnwindSafe for GraphCallable
impl Send for GraphCallable
impl Sync for GraphCallable
impl Unpin for GraphCallable
impl UnsafeUnpin for GraphCallable
impl !UnwindSafe for GraphCallable
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