export type CreateApiNotteAgentsStartArgs = {body: {task: string, session_id: string, url?: string | undefined, max_steps?: number | undefined, use_vision?: boolean | undefined}}; export type CreateApiNotteAgentsStartOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Start an AI agent to autonomously complete a browser task. * * POST /notte/agents/start */ export const createApiNotteAgentsStart = async (args: CreateApiNotteAgentsStartArgs, options?: CreateApiNotteAgentsStartOptions) => { 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(/\/+$/, '')}/notte/agents/start${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 };