export type GetApiTavilyResearchRequestIdArgs = {request_id: string}; export type GetApiTavilyResearchRequestIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Retrieve the status and results of a research task using its request ID. * * GET /tavily/research/{request_id} */ export const getApiTavilyResearchRequestId = async (args: GetApiTavilyResearchRequestIdArgs, options?: GetApiTavilyResearchRequestIdOptions) => { const {baseUrl = "https://api.orthogonal.com/mpp", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/tavily/research/${encodeURIComponent(String(args.request_id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };