pub struct BraveSearchTool { /* private fields */ }Expand description
Brave Search API tool for web search with privacy focus.
Requires a Brave Search API key. Get one from https://brave.com/search/api/.
§Example
ⓘ
use synaptic_tools::BraveSearchTool;
use synaptic_core::Tool;
let tool = BraveSearchTool::new("your-api-key").with_max_results(5);
let result = tool.call(serde_json::json!({"query": "Rust async runtime"})).await?;Implementations§
Trait Implementations§
Source§impl Tool for BraveSearchTool
impl Tool for BraveSearchTool
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 BraveSearchTool
impl !RefUnwindSafe for BraveSearchTool
impl Send for BraveSearchTool
impl Sync for BraveSearchTool
impl Unpin for BraveSearchTool
impl UnsafeUnpin for BraveSearchTool
impl !UnwindSafe for BraveSearchTool
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