export type DeleteApiV1AssistantsAssistantIdKnowledgeIdArgs = {assistantId: string, id: string}; export type DeleteApiV1AssistantsAssistantIdKnowledgeIdOptions = {baseUrl?: string | undefined, accountSidAuthToken?: {username: string, password: string} | undefined, fetch?: typeof fetch | undefined}; /** * Detach Knowledge to Assistant * * DELETE /v1/Assistants/{assistantId}/Knowledge/{id} */ export const deleteApiV1AssistantsAssistantIdKnowledgeId = async (args: DeleteApiV1AssistantsAssistantIdKnowledgeIdArgs, options?: DeleteApiV1AssistantsAssistantIdKnowledgeIdOptions) => { const {baseUrl = "https://assistants.twilio.com", fetch: fetchFn = fetch, accountSidAuthToken} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (accountSidAuthToken !== undefined) headers.set('authorization', `Basic ${btoa(`${accountSidAuthToken.username}:${accountSidAuthToken.password}`)}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/Assistants/${encodeURIComponent(String(args.assistantId))}/Knowledge/${encodeURIComponent(String(args.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 };