Skip to content

Function: runWebSearch()

runWebSearch(request, runtimeOrConfig, ctx, signal?, writeProgress?): Promise<{ answer: string; citations: object[]; model: string; query: string; }>

Run a web search. Prefers the Databricks native web-search tool on a deployed GPT/Gemini endpoint (synthesized answer + citations); when the workspace has no such endpoint AND the scrape fallback is enabled, falls back to a DuckDuckGo scrape so the tool still returns results instead of erroring. Citations are filtered through the configured URL allow-list.

signal cancels the whole call, including the in-flight serving request.

string = ...

string = ...

WebSearchRuntimeInput

WebSearchContext

AbortSignal

(event) => Promise<void>

Promise<{ answer: string; citations: object[]; model: string; query: string; }>