export type GetApiApiAgentStreamExecutionIdArgs = {executionId: string, 'Last-Event-ID'?: number | undefined}; export type GetApiApiAgentStreamExecutionIdOptions = {baseUrl?: string | undefined, apiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * GET /api/agent/stream/{executionId} */ export const getApiApiAgentStreamExecutionId = async (args: GetApiApiAgentStreamExecutionIdArgs, options?: GetApiApiAgentStreamExecutionIdOptions) => { const {baseUrl = "https://developer.orkescloud.com", fetch: fetchFn = fetch, apiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "*/*") if (args['Last-Event-ID'] != null) headers.set("Last-Event-ID", String(args['Last-Event-ID'])) if (apiKey !== undefined) headers.set("X-Authorization", apiKey) const url = `${baseUrl.replace(/\/+$/, '')}/api/agent/stream/${encodeURIComponent(String(args.executionId))}${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 res.blob() };