pub struct ToolInvocation { /* private fields */ }Expand description
Application-owned description of one tool invocation.
The lifecycle (pending, running, complete, failed) comes from the
enclosing Progressive; this type carries only what the call is and
what it produced.
Implementations§
Source§impl ToolInvocation
impl ToolInvocation
Sourcepub fn new(id: impl Into<SharedString>, name: impl Into<SharedString>) -> Self
pub fn new(id: impl Into<SharedString>, name: impl Into<SharedString>) -> Self
Creates an invocation with a stable application identifier and the tool name shown in the header.
Sourcepub fn summary(self, summary: impl Into<SharedString>) -> Self
pub fn summary(self, summary: impl Into<SharedString>) -> Self
Adds a one-line summary of the arguments (shown in the header).
Sourcepub fn input(self, input: impl Into<SharedString>) -> Self
pub fn input(self, input: impl Into<SharedString>) -> Self
Adds the full input the agent sent, rendered as code.
Sourcepub fn input_language(self, language: impl Into<SharedString>) -> Self
pub fn input_language(self, language: impl Into<SharedString>) -> Self
Sets the language used to highlight the input (default json).
Sourcepub fn output(self, output: impl Into<SharedString>) -> Self
pub fn output(self, output: impl Into<SharedString>) -> Self
Adds the tool’s result, rendered as selectable Markdown.
Sourcepub fn elapsed(self, elapsed: Duration) -> Self
pub fn elapsed(self, elapsed: Duration) -> Self
Adds caller-measured elapsed time; the component never owns a clock.
Sourcepub fn approval(self, approval: ToolApproval) -> Self
pub fn approval(self, approval: ToolApproval) -> Self
Sets the human approval state.
Sourcepub fn icon(self, icon: impl IconNamed) -> Self
pub fn icon(self, icon: impl IconNamed) -> Self
Replaces the default terminal glyph with a tool-specific icon.
Sourcepub fn summary_text(&self) -> Option<&SharedString>
pub fn summary_text(&self) -> Option<&SharedString>
Returns the one-line summary, when present.
Sourcepub fn approval_state(&self) -> ToolApproval
pub fn approval_state(&self) -> ToolApproval
Returns the approval state.
Trait Implementations§
Source§impl Clone for ToolInvocation
impl Clone for ToolInvocation
Source§fn clone(&self) -> ToolInvocation
fn clone(&self) -> ToolInvocation
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 ToolInvocation
impl Debug for ToolInvocation
impl Eq for ToolInvocation
Source§impl PartialEq for ToolInvocation
impl PartialEq for ToolInvocation
impl StructuralPartialEq for ToolInvocation
Auto Trait Implementations§
impl Freeze for ToolInvocation
impl RefUnwindSafe for ToolInvocation
impl Send for ToolInvocation
impl Sync for ToolInvocation
impl Unpin for ToolInvocation
impl UnsafeUnpin for ToolInvocation
impl UnwindSafe for ToolInvocation
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Span], returning an
Instrumented wrapper.§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§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
Subscriber to this type, returning a
[WithDispatch] wrapper.