export type DeleteApiAssistantsAssistantIdRemoveMeArgs = {assistant_id: number, cookie_name?: (string | null) | undefined}; export type DeleteApiAssistantsAssistantIdRemoveMeOptions = {baseUrl?: string | undefined, APIKeyHeader?: string | undefined, fetch?: typeof fetch | undefined}; /** * Leave an assistant * * DELETE /assistants/{assistant_id}/remove/me */ export const deleteApiAssistantsAssistantIdRemoveMe = async (args: DeleteApiAssistantsAssistantIdRemoveMeArgs, options?: DeleteApiAssistantsAssistantIdRemoveMeOptions) => { const {baseUrl = "https://api.your-domain.com", fetch: fetchFn = fetch, APIKeyHeader} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.cookie_name != null) query.append("cookie_name", String(args.cookie_name)) if (APIKeyHeader !== undefined) headers.set("X-API-KEY", APIKeyHeader) const url = `${baseUrl.replace(/\/+$/, '')}/assistants/${encodeURIComponent(String(args.assistant_id))}/remove/me${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 };