pub enum ToolCallState {
PendingApproval,
Running,
Succeeded {
output: ToolOutput,
},
Failed {
error: SharedString,
},
Refused {
reason: SharedString,
},
}Expand description
Where one invocation has got to.
The five are a closed set rather than flags, so a card cannot be running and failed at once, and cannot be refused without a reason: the host that declined has to say what it declined.
Variants§
PendingApproval
Nothing has run. Somebody has to allow it first.
Running
Succeeded
Fields
output: ToolOutputFailed
The tool ran and did not succeed, in the host’s own words.
Fields
error: SharedStringRefused
The host declined to run it, in the host’s own words. Nothing ran, so there is no result and no error — only a decision.
Fields
reason: SharedStringImplementations§
Source§impl ToolCallState
impl ToolCallState
pub fn succeeded(output: impl Into<ToolBody>) -> Self
Sourcepub fn succeeded_silently() -> Self
pub fn succeeded_silently() -> Self
A call that ran, succeeded, and returned nothing.
pub fn failed(error: impl Into<SharedString>) -> Self
pub fn refused(reason: impl Into<SharedString>) -> Self
Sourcepub fn as_str(&self) -> &'static str
pub fn as_str(&self) -> &'static str
The name the semantic node publishes, so a test asserts the state the card reported rather than the colour it painted.
Sourcepub fn reason(&self) -> Option<&SharedString>
pub fn reason(&self) -> Option<&SharedString>
Why this call did not produce a result, when that is a thing the host said. A failure’s error and a refusal’s reason are different sentences and are never rendered in the same place.
Trait Implementations§
Source§impl Clone for ToolCallState
impl Clone for ToolCallState
Source§fn clone(&self) -> ToolCallState
fn clone(&self) -> ToolCallState
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ToolCallState
impl Debug for ToolCallState
impl Eq for ToolCallState
Source§impl PartialEq for ToolCallState
impl PartialEq for ToolCallState
impl StructuralPartialEq for ToolCallState
Auto Trait Implementations§
impl Freeze for ToolCallState
impl RefUnwindSafe for ToolCallState
impl Send for ToolCallState
impl Sync for ToolCallState
impl Unpin for ToolCallState
impl UnsafeUnpin for ToolCallState
impl UnwindSafe for ToolCallState
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more