Support web search (#1370)

<!-- This is an auto-generated description by cubic. -->

## Summary by cubic
Adds web search to Dyad Pro chats with a new UI, tag parsing, and a Pro
Mode toggle that wires through to the engine.

- **New Features**
  - Pro Mode toggle: “Web Search” (settings.enableProWebSearch).
  - New custom tags: dyad-web-search, dyad-web-search-result, dyad-read.
- Collapsible Web Search Result UI with in-progress badge and markdown
rendering.
- Engine integration: passes enable_web_search and activates DyadEngine
when web search is on.

<!-- End of auto-generated description by cubic. -->
This commit is contained in:
Will Chen
2025-09-24 19:39:39 -07:00
committed by GitHub
parent 42a406e3ab
commit d96e95c1da
8 changed files with 217 additions and 1 deletions

View File

@@ -86,7 +86,8 @@ export async function getModelClient(
if (providerConfig.gatewayPrefix != null || dyadEngineUrl) {
const isEngineEnabled =
settings.enableProSmartFilesContextMode ||
settings.enableProLazyEditsMode;
settings.enableProLazyEditsMode ||
settings.enableProWebSearch;
const provider = isEngineEnabled
? createDyadEngine({
apiKey: dyadApiKey,
@@ -100,6 +101,7 @@ export async function getModelClient(
enableSmartFilesContext: settings.enableProSmartFilesContextMode,
// Keep in sync with getCurrentValue in ProModeSelector.tsx
smartContextMode: settings.proSmartContextOption ?? "balanced",
enableWebSearch: settings.enableProWebSearch,
},
settings,
})

View File

@@ -44,6 +44,7 @@ or to provide a custom fetch implementation for e.g. testing.
dyadOptions: {
enableLazyEdits?: boolean;
enableSmartFilesContext?: boolean;
enableWebSearch?: boolean;
smartContextMode?: "balanced" | "conservative";
};
settings: UserSettings;
@@ -158,6 +159,7 @@ export function createDyadEngine(
enable_smart_files_context:
options.dyadOptions.enableSmartFilesContext,
smart_context_mode: options.dyadOptions.smartContextMode,
enable_web_search: options.dyadOptions.enableWebSearch,
};
}