pub struct GraphHandle { /* private fields */ }Expand description
A built graph, ready to run many times. Outputs cross as JSON text; run ids as text. Agent nodes report events under their own run ids.
Implementations§
Source§impl GraphHandle
impl GraphHandle
Sourcepub async fn run(&self, input: String) -> Result<String, FfiError>
pub async fn run(&self, input: String) -> Result<String, FfiError>
Runs the graph on input to the end.
Output: the last node’s output as JSON text, or the error with
its code and run id.
Sourcepub async fn run_result(&self, input: String) -> Result<GraphResult, FfiError>
pub async fn run_result(&self, input: String) -> Result<GraphResult, FfiError>
Runs the graph on input to the end.
Output: the whole result: output and state as JSON text, usage,
steps and run id.
Sourcepub async fn start(&self, input: String) -> Result<String, FfiError>
pub async fn start(&self, input: String) -> Result<String, FfiError>
Starts a graph run on input with no node run yet and saves its
first checkpoint. Needs sqlite.
Output: the run id text, to continue with resume or resume_for.
Sourcepub async fn resume(&self, run_id: String) -> Result<String, FfiError>
pub async fn resume(&self, run_id: String) -> Result<String, FfiError>
Continues graph run run_id from its last checkpoint to the end.
Output: the last node’s output as JSON text, or the error.
The run must have been started by the same workflow.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for GraphHandle
impl !UnwindSafe for GraphHandle
impl Forget for GraphHandle
impl Freeze for GraphHandle
impl Move for GraphHandle
impl Send for GraphHandle
impl Sync for GraphHandle
impl Unpin for GraphHandle
impl UnsafeUnpin for GraphHandle
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