/** * @license * Copyright 2026 Steven Roussey * SPDX-License-Identifier: Apache-2.0 */ import type { IExecuteContext } from "@workglow/task-graph"; import type { IWebSearchProvider, WebSearchCapabilities, WebSearchRequest, WebSearchResponse } from "@workglow/web-search"; import OpenAI from "openai"; export interface OpenAiWebSearchOptions { readonly client?: OpenAI | undefined; readonly apiKey?: string | undefined; readonly model?: string | undefined; /** How much context window the search may spend. */ readonly searchContextSize?: "low" | "medium" | "high" | undefined; } export declare class OpenAiWebSearchProvider implements IWebSearchProvider { readonly name = "openai"; /** Reached through the vendor SDK, not a fetch this package owns. */ readonly endpoint: undefined; /** The SDK carries the key; `credentialKey` never reaches this request. */ readonly acceptsCredentialKey = false; readonly capabilities: WebSearchCapabilities; private client; private readonly apiKey; private readonly model; private readonly searchContextSize; constructor(options?: OpenAiWebSearchOptions); /** * Built on first search, not in the constructor, so registering the provider * cannot throw out of the vendor SDK on a machine that has no key yet, and a * missing key reports through this repo's named error rather than the SDK's. */ private getClient; search(request: WebSearchRequest, context: IExecuteContext): Promise; }