export type DeleteApiApiV1ConversationsConversationIdArgs = {conversation_id: string}; export type DeleteApiApiV1ConversationsConversationIdOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Delete Conversation * * DELETE /api/v1/conversations/{conversation_id} */ export const deleteApiApiV1ConversationsConversationId = async (args: DeleteApiApiV1ConversationsConversationIdArgs, options: DeleteApiApiV1ConversationsConversationIdOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/conversations/${encodeURIComponent(String(args.conversation_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 };