export type CreateApiTinyfishAgentV1AutomationRunResearchArgs = {body: {query: string, mode?: string | undefined, stream?: boolean | undefined, output_language?: string | undefined, browser_enabled?: boolean | undefined, weak_sources_enabled?: boolean | undefined, domain_type?: string | undefined, after_date?: string | undefined, before_date?: string | undefined, recency_minutes?: number | undefined, domain_filter?: Record | undefined, prior_run_id?: string | undefined, session_id?: string | undefined}}; export type CreateApiTinyfishAgentV1AutomationRunResearchOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Execute a source-backed research report with SSE streaming. Returns a comprehensive report with citations from web sources. Supports standard, deep, and max research modes. * * POST /tinyfish-agent/v1/automation/run-research */ export const createApiTinyfishAgentV1AutomationRunResearch = async (args: CreateApiTinyfishAgentV1AutomationRunResearchArgs, options?: CreateApiTinyfishAgentV1AutomationRunResearchOptions) => { const {baseUrl = "https://api.orthogonal.com/mpp", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/tinyfish-agent/v1/automation/run-research${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };