export type DeleteApiNotteAgentsAgentIdStopArgs = {agent_id: string, session_id: string}; export type DeleteApiNotteAgentsAgentIdStopOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Stop a running agent. * * DELETE /notte/agents/{agent_id}/stop */ export const deleteApiNotteAgentsAgentIdStop = async (args: DeleteApiNotteAgentsAgentIdStopArgs, options?: DeleteApiNotteAgentsAgentIdStopOptions) => { const {baseUrl = "https://api.orthogonal.com/mpp", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.session_id != null) query.append("session_id", String(args.session_id)) const url = `${baseUrl.replace(/\/+$/, '')}/notte/agents/${encodeURIComponent(String(args.agent_id))}/stop${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };