feat(webui): add BYOK web search settings

Let WebUI users configure the single web search provider credential from BYOK while keeping saved secrets masked and hot-reloaded for new searches.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Xubin Ren
2026-05-09 14:52:48 +08:00
committed by Xubin Ren
co-authored by Cursor
parent 7c1aa5ae31
commit 56eee06736
19 changed files with 861 additions and 66 deletions
+16
View File
@@ -4,6 +4,7 @@ import type {
SettingsPayload,
SettingsUpdate,
SlashCommand,
WebSearchSettingsUpdate,
} from "./types";
export class ApiError extends Error {
@@ -168,3 +169,18 @@ export async function updateProviderSettings(
token,
);
}
export async function updateWebSearchSettings(
token: string,
update: WebSearchSettingsUpdate,
base: string = "",
): Promise<SettingsPayload> {
const query = new URLSearchParams();
query.set("provider", update.provider);
if (update.apiKey !== undefined) query.set("api_key", update.apiKey);
if (update.baseUrl !== undefined) query.set("base_url", update.baseUrl);
return request<SettingsPayload>(
`${base}/api/settings/web-search/update?${query}`,
token,
);
}