pub struct ToolCallResult {
pub content: Vec<ToolContentItem>,
pub is_error: bool,
}Expand description
Result of calling a tool.
Fields§
§content: Vec<ToolContentItem>The content items returned by the tool.
is_error: boolWhether the tool returned an error.
Implementations§
Source§impl ToolCallResult
impl ToolCallResult
Sourcepub fn success(content: Vec<ToolContentItem>) -> Self
pub fn success(content: Vec<ToolContentItem>) -> Self
Creates a successful tool result with the given content.
Sourcepub fn text(text: impl Into<String>) -> Self
pub fn text(text: impl Into<String>) -> Self
Creates a successful tool result with a single text item.
Sourcepub fn first_text(&self) -> Option<&str>
pub fn first_text(&self) -> Option<&str>
Returns the first text content, if present.
Trait Implementations§
Source§impl Clone for ToolCallResult
impl Clone for ToolCallResult
Source§fn clone(&self) -> ToolCallResult
fn clone(&self) -> ToolCallResult
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ToolCallResult
impl RefUnwindSafe for ToolCallResult
impl Send for ToolCallResult
impl Sync for ToolCallResult
impl Unpin for ToolCallResult
impl UnwindSafe for ToolCallResult
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).