export type GetApiV1TaskAgentsAgentIdRunsRunIdEventsArgs = {agent_id: string, run_id: string}; export type GetApiV1TaskAgentsAgentIdRunsRunIdEventsOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Stream Run Events * * GET /v1/task-agents/{agent_id}/runs/{run_id}/events */ export const getApiV1TaskAgentsAgentIdRunsRunIdEvents = async (args: GetApiV1TaskAgentsAgentIdRunsRunIdEventsArgs, options?: GetApiV1TaskAgentsAgentIdRunsRunIdEventsOptions) => { const {baseUrl = "https://sdk.nimbleway.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/v1/task-agents/${encodeURIComponent(String(args.agent_id))}/runs/${encodeURIComponent(String(args.run_id))}/events${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 };