pub struct WebFetchTool;Expand description
网页获取工具:获取网页内容。
使用 HTTP 请求获取网页的 HTML 内容,支持超时设置。 与 HttpRequestTool 不同,这个工具专门用于获取网页内容。
输入格式:
{
"url": "https://example.com",
"timeout": 30
}Implementations§
Source§impl WebFetchTool
impl WebFetchTool
Trait Implementations§
Source§impl Default for WebFetchTool
impl Default for WebFetchTool
Source§impl Tool for WebFetchTool
impl Tool for WebFetchTool
Source§fn description(&self) -> Option<&str>
fn description(&self) -> Option<&str>
返回工具描述。
Source§fn categories(&self) -> &'static [ToolCategory]
fn categories(&self) -> &'static [ToolCategory]
返回工具分类。
Source§fn input_schema(&self) -> Value
fn input_schema(&self) -> Value
返回输入参数的 JSON Schema。
Source§fn call<'life0, 'async_trait>(
&'life0 self,
input: Value,
) -> Pin<Box<dyn Future<Output = Result<Value, ToolError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn call<'life0, 'async_trait>(
&'life0 self,
input: Value,
) -> Pin<Box<dyn Future<Output = Result<Value, ToolError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
执行网页获取。
Source§fn definition(&self) -> ToolDefinition
fn definition(&self) -> ToolDefinition
获取工具定义 (ToolDefinition) Read more
Auto Trait Implementations§
impl Freeze for WebFetchTool
impl RefUnwindSafe for WebFetchTool
impl Send for WebFetchTool
impl Sync for WebFetchTool
impl Unpin for WebFetchTool
impl UnsafeUnpin 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