export type ConversationRequest = {conversationId?: string | undefined, userPrompt?: string | undefined, approvalToUseMetadata?: boolean | undefined};
export type CreateApiApiBlastaiConversationUserArgs = {body: ConversationRequest};
export type CreateApiApiBlastaiConversationUserOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined};
/**
* Allowed user roles:
- sdzAdmin
- sdzReadOnly
- sdzUser
request conversational response to user's prompt; where the user is a developer/admin/user
*
* POST /api/blastai/conversation/user
*/
export const createApiApiBlastaiConversationUser = async (args: CreateApiApiBlastaiConversationUserArgs, options?: CreateApiApiBlastaiConversationUserOptions) => {
const {baseUrl = "https://api.burstiq.com", fetch: fetchFn = fetch} = options ?? {}
const query = new URLSearchParams()
const headers = new Headers()
headers.set('content-type', "application/json")
headers.set('accept', "*/*")
const url = `${baseUrl.replace(/\/+$/, '')}/api/blastai/conversation/user${query.size > 0 ? `?${query}` : ''}`
const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)})
if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}})
return res.blob()
};