Skip to main content

PausedRun

Struct PausedRun 

Source
pub struct PausedRun { /* private fields */ }
Expand description

A paused run: its requests, the answers given so far and its snapshot.

Implementations§

Source§

impl PausedRun

Source

pub fn from_json(json: String) -> Result<Arc<Self>, GraphrtError>

A paused run from the result JSON of a run that ended with status paused (what RunHandle.waitJson and EventListener.onFinish return), or from what PausedRun::to_json returned.

Source

pub fn to_json(&self) -> String

The paused run as JSON (requests and snapshot, not the answers), to store and read back with PausedRun::from_json. It holds the run’s variables (never secrets): keep it in the app’s private storage.

Source

pub fn run_id(&self) -> String

Run id of the paused run.

Source

pub fn snapshot_json(&self) -> String

The snapshot alone, for WorkflowHandle.resume.

Source

pub fn requests(&self) -> Vec<ApprovalRequest>

Every request of the run, in the order the nodes paused.

Source

pub fn unanswered(&self) -> Vec<String>

Keys of the requests that have no answer yet. Resuming with requests unanswered keeps those nodes paused.

Source

pub fn approve( &self, key: String, reason: Option<String>, ) -> Result<(), GraphrtError>

Approve request key: every held tool call runs, or a form is answered with its approve action and the fields’ defaults.

Source

pub fn reject( &self, key: String, reason: Option<String>, ) -> Result<(), GraphrtError>

Reject request key: the model is told the calls were not approved (and why, with reason), or a form is answered with its reject action.

Source

pub fn decide_tool_call( &self, key: String, call_id: String, approved: bool, ) -> Result<(), GraphrtError>

Approve or reject one held tool call of request key. Calls without a decision keep the node paused.

Source

pub fn answer( &self, key: String, action: String, values_json: String, ) -> Result<(), GraphrtError>

Answer the form of request key with action (one of its actions) and field values as a JSON object; fields left out get their defaults.

Source

pub fn set_input( &self, key: String, input_json: String, ) -> Result<(), GraphrtError>

Set the resume input of request key as raw JSON, for pause kinds the helpers above do not cover.

Source

pub fn inputs_json(&self) -> String

The resume inputs collected so far, as JSON (what WorkflowHandle.resume takes).

Trait Implementations§

Source§

impl Debug for PausedRun

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<UT> LiftRef<UT> for PausedRun

Source§

impl<UT> LowerError<UT> for PausedRun

Source§

fn lower_error(obj: Self) -> RustBuffer

Lower this value for scaffolding function return Read more
Source§

impl<UT> LowerReturn<UT> for PausedRun

Source§

type ReturnType = <Arc<PausedRun> as LowerReturn<UniFfiTag>>::ReturnType

The type that should be returned by scaffolding functions for this type. Read more
Source§

fn lower_return(obj: Self) -> Result<Self::ReturnType, RustCallError>

Lower the return value from an scaffolding call Read more
Source§

fn handle_failed_lift( error: LiftArgsError, ) -> Result<Self::ReturnType, RustCallError>

Lower the return value for failed argument lifts Read more
Source§

impl<UT> TypeId<UT> for PausedRun

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, UT> HandleAlloc<UT> for T
where T: Send + Sync,

Source§

fn new_handle(value: Arc<T>) -> Handle

Create a new handle for an Arc value Read more
Source§

unsafe fn clone_handle(handle: Handle) -> Handle

Clone a handle Read more
Source§

unsafe fn consume_handle(handle: Handle) -> Arc<T> ⓘ

Consume a handle, getting back the initial Arc<> Read more
Source§

unsafe fn get_arc(handle: Handle) -> Arc<Self> ⓘ

Get a clone of the Arc<> using a “borrowed” handle. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ParallelSend for T

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more