use adk_core::{Result, Tool, ToolContext, ToolEffect};
use async_trait::async_trait;
use serde_json::{Value, json};
use std::sync::Arc;
#[derive(Debug, Clone, Copy, Default)]
pub struct DeepSeekWebSearchTool;
impl DeepSeekWebSearchTool {
pub fn new() -> Self {
Self
}
}
#[async_trait]
impl Tool for DeepSeekWebSearchTool {
fn name(&self) -> &str {
"deepseek_web_search"
}
fn description(&self) -> &str {
"Searches the web for current information (DeepSeek server-side)."
}
fn is_builtin(&self) -> bool {
true
}
fn effect(&self) -> ToolEffect {
ToolEffect::ReadOnly
}
fn declaration(&self) -> Value {
json!({
"name": self.name(),
"description": self.description(),
"x-adk-openai-tool": { "type": "web_search" },
})
}
async fn execute(&self, _ctx: Arc<dyn ToolContext>, _args: Value) -> Result<Value> {
Err(adk_core::AdkError::tool("DeepSeek web search is handled by DeepSeek's Responses API"))
}
}