agent2: Allow tools to be provider specific (#36111)
Our WebSearch tool requires access to a Zed provider Release Notes: - N/A
This commit is contained in:
parent
7f1a5c6ad7
commit
2b3dbe8815
2 changed files with 26 additions and 4 deletions
|
@ -5,7 +5,9 @@ use agent_client_protocol as acp;
|
|||
use anyhow::{Result, anyhow};
|
||||
use cloud_llm_client::WebSearchResponse;
|
||||
use gpui::{App, AppContext, Task};
|
||||
use language_model::LanguageModelToolResultContent;
|
||||
use language_model::{
|
||||
LanguageModelProviderId, LanguageModelToolResultContent, ZED_CLOUD_PROVIDER_ID,
|
||||
};
|
||||
use schemars::JsonSchema;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use ui::prelude::*;
|
||||
|
@ -50,6 +52,11 @@ impl AgentTool for WebSearchTool {
|
|||
"Searching the Web".into()
|
||||
}
|
||||
|
||||
/// We currently only support Zed Cloud as a provider.
|
||||
fn supported_provider(&self, provider: &LanguageModelProviderId) -> bool {
|
||||
provider == &ZED_CLOUD_PROVIDER_ID
|
||||
}
|
||||
|
||||
fn run(
|
||||
self: Arc<Self>,
|
||||
input: Self::Input,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue