export type UpdateApiV1AgentsAgentIdAudioCacheEntryIdDetailsArgs = {body: BodyInit}; export type UpdateApiV1AgentsAgentIdAudioCacheEntryIdDetailsOptions = {baseUrl?: string | undefined, polyApiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Replace audio file and voice tuning settings * * PUT /v1/agents/{agentId}/audio-cache/{entryId}/details */ export const updateApiV1AgentsAgentIdAudioCacheEntryIdDetails = async (args: UpdateApiV1AgentsAgentIdAudioCacheEntryIdDetailsArgs, options?: UpdateApiV1AgentsAgentIdAudioCacheEntryIdDetailsOptions) => { const {baseUrl = "https://api.us.poly.ai", fetch: fetchFn = fetch, polyApiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (polyApiKey !== undefined) headers.set("X-API-KEY", polyApiKey) const url = `${baseUrl.replace(/\/+$/, '')}/v1/agents/${encodeURIComponent(String(args.agentId))}/audio-cache/${encodeURIComponent(String(args.entryId))}/details${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", headers, body: args.body}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };