export type GetApiGpt62AstraCodexOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Gpt 6 2 Astra Codex * * GET /gpt-6-2-astra-codex */ export const getApiGpt62AstraCodex = async (options: GetApiGpt62AstraCodexOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "text/html") const url = `${baseUrl.replace(/\/+$/, '')}/gpt-6-2-astra-codex${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 res.text() };