pub struct URLFetchTool { /* private fields */ }Expand description
Web page fetching tool
Implementations§
Source§impl URLFetchTool
impl URLFetchTool
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a web fetching tool (SSRF protection enabled by default).
The HTTP client is built per request inside guarded_get so the
validated DNS answers can be pinned onto it (A3 DNS-rebinding closure).
Sourcepub fn with_allow_private_ips(self, allow: bool) -> Self
pub fn with_allow_private_ips(self, allow: bool) -> Self
Allow requests to private/internal IP addresses (SSRF opt-in).
Trait Implementations§
Source§impl BaseTool for URLFetchTool
impl BaseTool for URLFetchTool
Source§fn description(&self) -> &str
fn description(&self) -> &str
Returns the tool description. Read more
Source§fn run<'life0, 'async_trait>(
&'life0 self,
input: String,
) -> Pin<Box<dyn Future<Output = Result<String, ToolError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn run<'life0, 'async_trait>(
&'life0 self,
input: String,
) -> Pin<Box<dyn Future<Output = Result<String, ToolError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Execute the tool (string version). Read more
Source§fn return_direct(&self) -> bool
fn return_direct(&self) -> bool
Whether to return result directly to user. Read more
Source§fn risk(&self) -> ToolRiskProfile
fn risk(&self) -> ToolRiskProfile
Declared Rule-of-Two risk profile (A2, v0.22.1). Read more
Source§impl Default for URLFetchTool
impl Default for URLFetchTool
Source§impl Tool for URLFetchTool
impl Tool for URLFetchTool
Source§type Input = URLFetchInput
type Input = URLFetchInput
Input type (must support deserialization and JSON Schema).
Source§type Output = URLFetchOutput
type Output = URLFetchOutput
Output type (must support serialization).
Source§fn invoke<'life0, 'async_trait>(
&'life0 self,
input: Self::Input,
) -> Pin<Box<dyn Future<Output = Result<Self::Output, ToolError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn invoke<'life0, 'async_trait>(
&'life0 self,
input: Self::Input,
) -> Pin<Box<dyn Future<Output = Result<Self::Output, ToolError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Execute the tool. Read more
Source§fn args_schema(&self) -> Option<Value>
fn args_schema(&self) -> Option<Value>
Returns the input JSON Schema.
Auto Trait Implementations§
impl Freeze for URLFetchTool
impl RefUnwindSafe for URLFetchTool
impl Send for URLFetchTool
impl Sync for URLFetchTool
impl Unpin for URLFetchTool
impl UnsafeUnpin for URLFetchTool
impl UnwindSafe for URLFetchTool
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