pub struct WikipediaTool { /* private fields */ }Expand description
A tool that searches Wikipedia and returns article summaries.
Uses the free Wikipedia REST API — no API key required.
§Example
ⓘ
use synaptic_tools::WikipediaTool;
use synaptic_core::Tool;
let tool = WikipediaTool::new();
let result = tool.call(serde_json::json!({"query": "Rust programming language"})).await?;Implementations§
Source§impl WikipediaTool
impl WikipediaTool
pub fn new() -> Self
pub fn with_language(self, language: impl Into<String>) -> Self
pub fn with_max_results(self, max_results: usize) -> Self
Trait Implementations§
Source§impl Default for WikipediaTool
impl Default for WikipediaTool
Source§impl Tool for WikipediaTool
impl Tool for WikipediaTool
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 WikipediaTool
impl !RefUnwindSafe for WikipediaTool
impl Send for WikipediaTool
impl Sync for WikipediaTool
impl Unpin for WikipediaTool
impl UnsafeUnpin for WikipediaTool
impl !UnwindSafe for WikipediaTool
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