pub struct DuckDuckGoTool { /* private fields */ }Expand description
A search tool powered by the DuckDuckGo Instant Answer API.
No API key is required. Results include the abstract (featured snippet), related topics, and answer when available.
§Example
ⓘ
use synaptic_tools::DuckDuckGoTool;
use synaptic_core::Tool;
let tool = DuckDuckGoTool::new();
let result = tool.call(serde_json::json!({"query": "Rust programming"})).await?;Implementations§
Source§impl DuckDuckGoTool
impl DuckDuckGoTool
pub fn new() -> Self
pub fn with_max_results(self, max_results: usize) -> Self
Trait Implementations§
Source§impl Default for DuckDuckGoTool
impl Default for DuckDuckGoTool
Source§impl Tool for DuckDuckGoTool
impl Tool for DuckDuckGoTool
fn name(&self) -> &'static str
fn description(&self) -> &'static str
fn parameters(&self) -> Option<Value>
fn call<'life0, 'async_trait>(
&'life0 self,
args: Value,
) -> Pin<Box<dyn Future<Output = Result<Value, SynapticError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn as_tool_definition(&self) -> ToolDefinition
Auto Trait Implementations§
impl Freeze for DuckDuckGoTool
impl !RefUnwindSafe for DuckDuckGoTool
impl Send for DuckDuckGoTool
impl Sync for DuckDuckGoTool
impl Unpin for DuckDuckGoTool
impl UnsafeUnpin for DuckDuckGoTool
impl !UnwindSafe for DuckDuckGoTool
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