export type CreateApiOlostepV1AnswersArgs = {body: {task: string, json_format?: Record | undefined}}; export type CreateApiOlostepV1AnswersOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * The AI will perform actions like searching and browsing web pages to find the answer to the provided task. Execution time is 3-30s depending upon complexity. For longer tasks, use the agent endpoint instead. * * POST /olostep/v1/answers */ export const createApiOlostepV1Answers = async (args: CreateApiOlostepV1AnswersArgs, options?: CreateApiOlostepV1AnswersOptions) => { const {baseUrl = "https://api.orthogonal.com/mpp", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/olostep/v1/answers${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 undefined };