pub struct WebSearchTool;Expand description
P4c (S2 module 5 tools.web): perform a web search. supercode bundles no
search provider of its own (S4a “single tool… no loop changes” scope —
not a search-engine implementation); a configured search endpoint
(SUPERCODE_WEB_SEARCH_URL, queried as <url>?q=<query>) is required,
same “bring your own credential/endpoint” posture Config::base_url
already has for the model provider itself. Absent that, the tool returns
a clear configuration error rather than silently no-op’ing.
Trait Implementations§
Source§impl Tool for WebSearchTool
impl Tool for WebSearchTool
Source§fn description(&self) -> &str
fn description(&self) -> &str
The built-in description. May be overridden via
crate::Config.Source§fn parameters(&self) -> Value
fn parameters(&self) -> Value
JSON Schema describing the tool’s input object.
Source§fn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
args: Value,
ctx: &'life1 ToolContext,
) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
WebSearchTool: 'async_trait,
fn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
args: Value,
ctx: &'life1 ToolContext,
) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
WebSearchTool: 'async_trait,
Run the tool. Returns text to feed back to the model.
Auto Trait Implementations§
impl Freeze for WebSearchTool
impl RefUnwindSafe for WebSearchTool
impl Send for WebSearchTool
impl Sync for WebSearchTool
impl Unpin for WebSearchTool
impl UnsafeUnpin for WebSearchTool
impl UnwindSafe for WebSearchTool
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