pub struct NativeWrappedTool { /* private fields */ }Expand description
Wraps a built-in tool (Calculator / DateTimeTool) as a single-
chunk stream. D9 backwards-compat: built-ins keep working
byte-equal; their materialized output becomes the terminator
chunk’s delta.
This impl is rarely exercised by 34.d test paths (built-ins
don’t declare stream effects, so is_streaming is false on
their registry entries and the dispatcher takes the
synchronous path). The impl exists for completeness — adopters
who programmatically flag a built-in as streaming (e.g. for
testing) get a working single-chunk stream.
Implementations§
Trait Implementations§
Source§impl Tool for NativeWrappedTool
impl Tool for NativeWrappedTool
Source§fn execute<'life0, 'async_trait>(
&'life0 self,
args: String,
_ctx: ToolContext,
) -> Pin<Box<dyn Future<Output = ToolResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execute<'life0, 'async_trait>(
&'life0 self,
args: String,
_ctx: ToolContext,
) -> Pin<Box<dyn Future<Output = ToolResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Execute the tool synchronously. Returns a single materialized
ToolResult. EVERY tool MUST implement this method
(no default — there’s no sensible default execute).Source§fn stream<'life0, 'async_trait>(
&'life0 self,
args: String,
ctx: ToolContext,
) -> Pin<Box<dyn Future<Output = ToolStream> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn stream<'life0, 'async_trait>(
&'life0 self,
args: String,
ctx: ToolContext,
) -> Pin<Box<dyn Future<Output = ToolStream> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn is_streaming(&self) -> bool
fn is_streaming(&self) -> bool
Whether this tool is a stream producer. Default:
false. Read moreAuto Trait Implementations§
impl Freeze for NativeWrappedTool
impl RefUnwindSafe for NativeWrappedTool
impl Send for NativeWrappedTool
impl Sync for NativeWrappedTool
impl Unpin for NativeWrappedTool
impl UnsafeUnpin for NativeWrappedTool
impl UnwindSafe for NativeWrappedTool
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> 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>
Converts
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>
Converts
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 moreCreates a shared type from an unshared type.