export type DeleteApiAssistantsAssistantNameArgs = {'X-Pinecone-Api-Version': string, assistant_name: string}; export type DeleteApiAssistantsAssistantNameOptions = {baseUrl?: string | undefined, ApiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete an assistant * * DELETE /assistants/{assistant_name} */ export const deleteApiAssistantsAssistantName = async (args: DeleteApiAssistantsAssistantNameArgs, options?: DeleteApiAssistantsAssistantNameOptions) => { const {baseUrl = "https://api.pinecone.io", fetch: fetchFn = fetch, ApiKeyAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['X-Pinecone-Api-Version'] != null) headers.set("X-Pinecone-Api-Version", String(args['X-Pinecone-Api-Version'])) if (ApiKeyAuth !== undefined) headers.set("Api-Key", ApiKeyAuth) const url = `${baseUrl.replace(/\/+$/, '')}/assistants/${encodeURIComponent(String(args.assistant_name))}${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 };