export type DeleteApiV1LibraryPersonasPersonaIdVoiceConfigArgs = {persona_id: string}; export type DeleteApiV1LibraryPersonasPersonaIdVoiceConfigOptions = {baseUrl: string, APIKeyHeader?: string | undefined, fetch?: typeof fetch | undefined}; /** * Detach the voice preset from a library persona (Feather staff only) * * DELETE /v1/library/personas/{persona_id}/voice-config */ export const deleteApiV1LibraryPersonasPersonaIdVoiceConfig = async (args: DeleteApiV1LibraryPersonasPersonaIdVoiceConfigArgs, options: DeleteApiV1LibraryPersonasPersonaIdVoiceConfigOptions) => { const {baseUrl, fetch: fetchFn = fetch, APIKeyHeader} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (APIKeyHeader !== undefined) headers.set("x-api-key", APIKeyHeader) const url = `${baseUrl.replace(/\/+$/, '')}/v1/library/personas/${encodeURIComponent(String(args.persona_id))}/voice-config${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 };