export type DeleteApiV1AgentsAgentIdArgs = {agent_id: string}; export type DeleteApiV1AgentsAgentIdOptions = {baseUrl?: string | undefined, ApiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete an agent entity. * * DELETE /v1/agents/{agent_id} */ export const deleteApiV1AgentsAgentId = async (args: DeleteApiV1AgentsAgentIdArgs, options?: DeleteApiV1AgentsAgentIdOptions) => { const {baseUrl = "https://api.mistral.ai", fetch: fetchFn = fetch, ApiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (ApiKey !== undefined) headers.set('authorization', `Bearer ${ApiKey}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/agents/${encodeURIComponent(String(args.agent_id))}${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 };