pub struct WebSearchTool { /* private fields */ }Expand description
Tool for searching the web using DuckDuckGo
This tool searches DuckDuckGo’s lite endpoint and returns organic search results. It does not require an API key, making it a free alternative to paid search APIs.
§Examples
ⓘ
use mojentic::llm::tools::web_search_tool::WebSearchTool;
use std::collections::HashMap;
let tool = WebSearchTool::new();
let mut args = HashMap::new();
args.insert("query".to_string(), serde_json::json!("Rust programming"));
let results = tool.run(&args)?;
// results contains an array of search results with title, url, and snippetImplementations§
Source§impl WebSearchTool
impl WebSearchTool
Trait Implementations§
Source§impl Clone for WebSearchTool
impl Clone for WebSearchTool
Source§fn clone(&self) -> WebSearchTool
fn clone(&self) -> WebSearchTool
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 Default for WebSearchTool
impl Default for WebSearchTool
Auto Trait Implementations§
impl Freeze for WebSearchTool
impl !RefUnwindSafe for WebSearchTool
impl Send for WebSearchTool
impl Sync for WebSearchTool
impl Unpin 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