export type CreateApiApiChatsIdContinueArgs = {id: string, body: {input?: string | undefined, inputParams?: ({foo?: string | undefined, var1?: string | undefined, var2?: number | undefined, var3?: Array | undefined}) | undefined, attachments?: (Array<{binaryBase64: string, contentType: string, inputFieldName?: (string | null) | undefined}>) | undefined}}; export type CreateApiApiChatsIdContinueOptions = {baseUrl?: string | undefined, ApiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * continue * * POST /api/chats/{id}/continue */ export const createApiApiChatsIdContinue = async (args: CreateApiApiChatsIdContinueArgs, options?: CreateApiApiChatsIdContinueOptions) => { const {baseUrl = "https://llm-api.treasuredata.com", fetch: fetchFn = fetch, ApiKeyAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "text/event-stream") if (ApiKeyAuth !== undefined) headers.set('authorization', `TD1 ${ApiKeyAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/chats/${encodeURIComponent(String(args.id))}/continue${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.text() };