export type GetApiJoinmassiveAiBatchesArgs = {id: string}; export type GetApiJoinmassiveAiBatchesOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Retrieve status of batch AI conversations. * * GET /joinmassive/ai/batches */ export const getApiJoinmassiveAiBatches = async (args: GetApiJoinmassiveAiBatchesArgs, options?: GetApiJoinmassiveAiBatchesOptions) => { const {baseUrl = "https://api.orthogonal.com/mpp", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.id != null) query.append("id", String(args.id)) const url = `${baseUrl.replace(/\/+$/, '')}/joinmassive/ai/batches${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };