pub struct WebFetchTool { /* private fields */ }Expand description
Tool for fetching web content.
- HTML is converted to markdown
- JSON is pretty-printed
- Other content returned as-is
Implementations§
Source§impl WebFetchTool
impl WebFetchTool
Sourcepub fn with_client(client: Client) -> Self
pub fn with_client(client: Client) -> Self
Creates a webfetch tool with a custom client.
Trait Implementations§
Source§impl Clone for WebFetchTool
impl Clone for WebFetchTool
Source§fn clone(&self) -> WebFetchTool
fn clone(&self) -> WebFetchTool
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 moreSource§impl Debug for WebFetchTool
impl Debug for WebFetchTool
Source§impl Default for WebFetchTool
impl Default for WebFetchTool
Source§impl<Deps: Send + Sync> Tool<Deps> for WebFetchTool
impl<Deps: Send + Sync> Tool<Deps> for WebFetchTool
Source§fn definition(&self) -> ToolDefinition
fn definition(&self) -> ToolDefinition
Get the tool’s definition. Read more
Source§fn call<'life0, 'life1, 'async_trait>(
&'life0 self,
_ctx: &'life1 RunContext<Deps>,
args: Value,
) -> Pin<Box<dyn Future<Output = ToolResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn call<'life0, 'life1, 'async_trait>(
&'life0 self,
_ctx: &'life1 RunContext<Deps>,
args: Value,
) -> Pin<Box<dyn Future<Output = ToolResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Execute the tool with given arguments. Read more
Source§fn prepare<'life0, 'life1, 'async_trait>(
&'life0 self,
_ctx: &'life1 RunContext<Deps>,
def: ToolDefinition,
) -> Pin<Box<dyn Future<Output = Option<ToolDefinition>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn prepare<'life0, 'life1, 'async_trait>(
&'life0 self,
_ctx: &'life1 RunContext<Deps>,
def: ToolDefinition,
) -> Pin<Box<dyn Future<Output = Option<ToolDefinition>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Prepare the tool definition at runtime. Read more
Source§fn description(&self) -> String
fn description(&self) -> String
Get the tool description.
Auto Trait Implementations§
impl Freeze for WebFetchTool
impl !RefUnwindSafe for WebFetchTool
impl Send for WebFetchTool
impl Sync for WebFetchTool
impl Unpin for WebFetchTool
impl !UnwindSafe for WebFetchTool
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