agent: Switch to new web search provider (#29951)

Release Notes:

- N/A
This commit is contained in:
Bennet Bo Fenner 2025-05-06 00:47:11 +02:00 committed by GitHub
parent 9568fa1166
commit 2aa06d1d0f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 66 additions and 65 deletions

View file

@ -7,7 +7,9 @@ use gpui::{App, AppContext, Context, Entity, Subscription, Task};
use http_client::{HttpClient, Method};
use language_model::{LlmApiToken, RefreshLlmTokenListener};
use web_search::{WebSearchProvider, WebSearchProviderId};
use zed_llm_client::{WebSearchBody, WebSearchResponse};
use zed_llm_client::{
CLIENT_SUPPORTS_EXA_WEB_SEARCH_PROVIDER_HEADER_NAME, WebSearchBody, WebSearchResponse,
};
pub struct CloudWebSearchProvider {
state: Entity<State>,
@ -84,6 +86,7 @@ async fn perform_web_search(
let request = request_builder
.header("Content-Type", "application/json")
.header("Authorization", format!("Bearer {token}"))
.header(CLIENT_SUPPORTS_EXA_WEB_SEARCH_PROVIDER_HEADER_NAME, "true")
.body(serde_json::to_string(&body)?.into())?;
let mut response = http_client
.send(request)