export type DeleteApiV1ConversationsConversationIdArgs = {conversation_id: string}; export type DeleteApiV1ConversationsConversationIdOptions = {baseUrl?: string | undefined, ApiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a conversation. * * DELETE /v1/conversations/{conversation_id} */ export const deleteApiV1ConversationsConversationId = async (args: DeleteApiV1ConversationsConversationIdArgs, options?: DeleteApiV1ConversationsConversationIdOptions) => { 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/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 };