pub struct WebFetchTool { /* private fields */ }Available on crate feature
web only.Expand description
Web page fetching tool
Fetches content from the specified URL, converting HTML to readable text.
Implementations§
Source§impl WebFetchTool
impl WebFetchTool
Sourcepub fn new() -> WebFetchTool
pub fn new() -> WebFetchTool
Create a new WebFetchTool
Sourcepub fn with_max_content_length(self, n: usize) -> WebFetchTool
pub fn with_max_content_length(self, n: usize) -> WebFetchTool
Set the maximum content length (in characters)
Sourcepub fn with_text_width(self, width: usize) -> WebFetchTool
pub fn with_text_width(self, width: usize) -> WebFetchTool
Set the HTML-to-text line width
Trait Implementations§
Source§impl Default for WebFetchTool
impl Default for WebFetchTool
Source§fn default() -> WebFetchTool
fn default() -> WebFetchTool
Returns the “default value” for a type. Read more
Source§impl Tool for WebFetchTool
impl Tool for WebFetchTool
Source§fn description(&self) -> &str
fn description(&self) -> &str
Human-readable tool description.
Source§fn parameters(&self) -> Value
fn parameters(&self) -> Value
JSON Schema describing accepted parameters.
Source§fn execute(
&self,
parameters: HashMap<String, Value>,
) -> Pin<Box<dyn Future<Output = Result<ToolResult, ReactError>> + Send + '_>>
fn execute( &self, parameters: HashMap<String, Value>, ) -> Pin<Box<dyn Future<Output = Result<ToolResult, ReactError>> + Send + '_>>
Execute the tool with untyped JSON parameters.
Source§fn validate_parameters(
&self,
_params: &HashMap<String, Value>,
) -> Pin<Box<dyn Future<Output = Result<(), ReactError>> + Send + '_>>
fn validate_parameters( &self, _params: &HashMap<String, Value>, ) -> Pin<Box<dyn Future<Output = Result<(), ReactError>> + Send + '_>>
Validate parameters before execution.
Source§fn permissions(&self) -> Vec<ToolPermission>
fn permissions(&self) -> Vec<ToolPermission>
Permissions required to invoke this tool.
Source§fn risk_level(&self) -> ToolRiskLevel
fn risk_level(&self) -> ToolRiskLevel
Risk level of this tool. Dangerous tools require explicit approval.
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
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request