export type CreateApiAgentphoneV1AgentsArgs = {body: {name: string, voiceMode?: string | undefined, systemPrompt?: string | undefined, beginMessage?: string | undefined, voice?: string | undefined, modelTier?: string | undefined, transferNumber?: string | undefined, voicemailMessage?: string | undefined}}; export type CreateApiAgentphoneV1AgentsOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Create a new agent with name, voice, system prompt, and voice mode. * * POST /agentphone/v1/agents */ export const createApiAgentphoneV1Agents = async (args: CreateApiAgentphoneV1AgentsArgs, options?: CreateApiAgentphoneV1AgentsOptions) => { 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(/\/+$/, '')}/agentphone/v1/agents${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 };