@howells/fieldwork-sdk 0.10.2 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/README.md +104 -16
  2. package/dist/{adapter-DWYJys20.js → adapter-CBSAfErv.js} +1 -1
  3. package/dist/adapter-J2yatZJ0.d.ts +73 -0
  4. package/dist/best-CO9liYDa.js +1436 -0
  5. package/dist/brave.d.ts +7 -6
  6. package/dist/brave.js +180 -173
  7. package/dist/browserbase.d.ts +4 -3
  8. package/dist/browserbase.js +185 -170
  9. package/dist/{document-DMIUCoDA.js → document-BSCwJgBM.js} +4 -4
  10. package/dist/{download-CP8noBdX.js → download-kuTqNnuZ.js} +1 -1
  11. package/dist/{adapter-DQrBP1tj.d.ts → errors-gMtejKHc.d.ts} +111 -70
  12. package/dist/exa.d.ts +18 -11
  13. package/dist/exa.js +306 -275
  14. package/dist/fieldwork-D7npPoUf.d.ts +35 -0
  15. package/dist/firecrawl.d.ts +4 -3
  16. package/dist/firecrawl.js +450 -417
  17. package/dist/{parse-Q7H4mrnO.js → http-CJcvTPnE.js} +223 -225
  18. package/dist/image.d.ts +253 -0
  19. package/dist/image.js +1 -0
  20. package/dist/index.d.ts +6 -7
  21. package/dist/index.js +67 -82
  22. package/dist/{job-DnavRq_s.js → job-JLEpszjr.js} +9 -9
  23. package/dist/kernel.d.ts +20 -2
  24. package/dist/kernel.js +65 -19
  25. package/dist/llamaparse.d.ts +3 -2
  26. package/dist/llamaparse.js +16 -16
  27. package/dist/parallel.d.ts +9 -9
  28. package/dist/parallel.js +423 -389
  29. package/dist/path-DO2llIdp.js +10 -0
  30. package/dist/perplexity.d.ts +6 -5
  31. package/dist/perplexity.js +21 -21
  32. package/dist/reducto.d.ts +3 -2
  33. package/dist/reducto.js +14 -14
  34. package/dist/{schema-BFjS6CSz.d.ts → schema-C9xzRkKJ.d.ts} +17 -6
  35. package/dist/{schema--iU4AXSM.js → schema-CJXFAZ-x.js} +12 -3
  36. package/dist/serpapi.d.ts +63 -5
  37. package/dist/serpapi.js +374 -144
  38. package/dist/tavily.d.ts +4 -3
  39. package/dist/tavily.js +247 -234
  40. package/dist/tools.d.ts +76 -15
  41. package/dist/tools.js +522 -154
  42. package/dist/{types-rc8bl8Em.js → types-mq6d6YOK.js} +1 -0
  43. package/dist/{util-DFUXQX6v.js → util-LvME_uOj.js} +35 -11
  44. package/package.json +7 -2
  45. package/dist/fieldwork-JCfyw58T.d.ts +0 -113
  46. package/dist/path-DL5P8XH2.js +0 -17
  47. package/dist/util-DhYr1OS3.d.ts +0 -1
  48. package/dist/{errors-DkFJysIM.js → errors-gpxg6Tnh.js} +5 -5
package/dist/kernel.js CHANGED
@@ -1,10 +1,10 @@
1
- import { t as defineAdapter } from "./adapter-DWYJys20.js";
2
- import { a as presentFile, i as header, n as byteLimit, o as tooLarge, r as checkFileUrl, t as MIB } from "./download-CP8noBdX.js";
3
- import { r as invalidRequest, t as FieldworkError } from "./errors-DkFJysIM.js";
4
- import { C as createRawClient, E as segment, S as withOriginal, T as requireKey, a as looseObject, d as optionalId, f as optionalNumber, h as optionalString, l as optionalBoolean, n as anything, p as optionalObject, s as optionalAnyString, v as recordOf } from "./parse-Q7H4mrnO.js";
5
- import { a as compact, l as presentPage, p as requireJobId, s as meta, t as callSettings } from "./util-DFUXQX6v.js";
6
- import { r as runJob } from "./job-DnavRq_s.js";
7
- import * as z from "zod/mini";
1
+ import { t as defineAdapter } from "./adapter-CBSAfErv.js";
2
+ import { a as presentFile, i as header, n as byteLimit, o as tooLarge, r as checkFileUrl, t as MIB } from "./download-kuTqNnuZ.js";
3
+ import { r as invalidRequest, t as FieldworkError } from "./errors-gpxg6Tnh.js";
4
+ import { O as withOriginal, _ as optionalId, c as anything, d as looseObject, h as optionalBoolean, i as segment, p as optionalAnyString, r as requireKey, t as createRawClient, v as optionalNumber, w as recordOf, x as optionalString, y as optionalObject } from "./http-CJcvTPnE.js";
5
+ import { a as compact, f as requireJobId, l as presentPage, s as meta, t as callSettings } from "./util-LvME_uOj.js";
6
+ import { r as runJob } from "./job-JLEpszjr.js";
7
+ import * as z$1 from "zod/mini";
8
8
  import TurndownService from "turndown";
9
9
  // src/adapters/kernel/response.ts
10
10
  /** `POST /browsers`. The id keeps the value as it arrived, for the error raised when there is none. */
@@ -23,6 +23,7 @@ const ExecuteResponse = looseObject({
23
23
  error: optionalString,
24
24
  result: anything,
25
25
  stderr: optionalAnyString,
26
+ stdout: optionalAnyString,
26
27
  success: optionalBoolean
27
28
  });
28
29
  /** What the read script returns: the page after it rendered. */
@@ -105,7 +106,7 @@ const billedTime = async (raw, id, call) => {
105
106
  try {
106
107
  return { uptimeMs: await runJob("kernel", {
107
108
  check: async (sessionId, request) => {
108
- const body = z.parse(DeletedBrowserResponse, await raw.request("GET", `/browsers/${segment(sessionId)}`, {
109
+ const body = z$1.parse(DeletedBrowserResponse, await raw.request("GET", `/browsers/${segment(sessionId)}`, {
109
110
  ...request,
110
111
  query: { include_deleted: true }
111
112
  }));
@@ -149,7 +150,7 @@ const inSession = async (raw, o, call, work) => {
149
150
  })
150
151
  })
151
152
  });
152
- const id = requireJobId(provider, z.parse(BrowserResponse, created).session_id);
153
+ const id = requireJobId(provider, z$1.parse(BrowserResponse, created).session_id);
153
154
  const done = await settle(work(id));
154
155
  const unreleased = await release(raw, id, call.retries);
155
156
  if (!done.ok) {
@@ -189,6 +190,10 @@ const inSession = async (raw, o, call, work) => {
189
190
  // src/adapters/kernel.ts
190
191
  /** Seconds Kernel gives the read script, within its 300-second limit. */
191
192
  const READ_SCRIPT_SECONDS = 120;
193
+ /** Seconds Kernel gives an `act` script when the call sets no timeout. */
194
+ const ACT_SCRIPT_SECONDS = 120;
195
+ /** The longest Kernel runs a script. */
196
+ const MAX_SCRIPT_SECONDS = 300;
192
197
  /** The largest file `download` returns: what Kernel's script results carry reliably. */
193
198
  const DOWNLOAD_CEILING = 50 * MIB;
194
199
  /** Seconds Kernel gives the download script, within its 300-second limit. */
@@ -283,12 +288,12 @@ const render = async (raw, id, url, call) => {
283
288
  timeout_sec: READ_SCRIPT_SECONDS
284
289
  }
285
290
  });
286
- const body = z.parse(ExecuteResponse, response);
291
+ const body = z$1.parse(ExecuteResponse, response);
287
292
  if (body.success !== true) throw new FieldworkError("ProviderError", `kernel could not load ${url}: ${body.error ?? "the script failed without an error"}`, {
288
293
  cause: response,
289
294
  provider
290
295
  });
291
- const page = z.parse(RenderedPage, body.result);
296
+ const page = z$1.parse(RenderedPage, body.result);
292
297
  if (page.html === void 0) throw new FieldworkError("ProviderError", `kernel loaded ${url} but the script returned no HTML`, {
293
298
  cause: response,
294
299
  provider
@@ -300,7 +305,7 @@ const render = async (raw, id, url, call) => {
300
305
  };
301
306
  };
302
307
  /** Loads the page in a new session and builds the result. */
303
- const readPage = async (raw, url, options) => {
308
+ const readPage = async (raw, url, options = {}) => {
304
309
  const { provider } = raw;
305
310
  const { call, rest: o } = callSettings(options);
306
311
  checkUrl(provider, url);
@@ -326,7 +331,7 @@ const readPage = async (raw, url, options) => {
326
331
  }));
327
332
  };
328
333
  /** Fetches the file in a new session and checks it. */
329
- const downloadFile = async (raw, url, options) => {
334
+ const downloadFile = async (raw, url, options = {}) => {
330
335
  const { provider } = raw;
331
336
  const { call, rest: o } = callSettings(options);
332
337
  checkFileUrl(provider, url);
@@ -339,13 +344,13 @@ const downloadFile = async (raw, url, options) => {
339
344
  timeout_sec: DOWNLOAD_SCRIPT_SECONDS
340
345
  }
341
346
  });
342
- const body = z.parse(ExecuteResponse, response);
347
+ const body = z$1.parse(ExecuteResponse, response);
343
348
  if (body.success !== true) throw new FieldworkError("ProviderError", `kernel could not download ${url}: ${body.error ?? "the script failed without an error"}`, {
344
349
  cause: response,
345
350
  provider
346
351
  });
347
352
  return {
348
- file: z.parse(FetchedFile, body.result),
353
+ file: z$1.parse(FetchedFile, body.result),
349
354
  response
350
355
  };
351
356
  });
@@ -373,7 +378,47 @@ const downloadFile = async (raw, url, options) => {
373
378
  }, limit);
374
379
  };
375
380
  /**
376
- * An adapter for Kernel: read, download and browser. Pass it to `new Fieldwork({ adapter })`.
381
+ * The script's limit in seconds: the call's timeout (at least 1), or 120
382
+ * without one. Throws `InvalidRequest` for one over 300 seconds.
383
+ */
384
+ const scriptSeconds = (provider, timeout) => {
385
+ if (timeout === void 0) return ACT_SCRIPT_SECONDS;
386
+ const seconds = Math.max(1, Math.ceil(timeout / 1e3));
387
+ if (seconds > MAX_SCRIPT_SECONDS) throw invalidRequest(provider, `runs a script for at most ${MAX_SCRIPT_SECONDS} seconds`);
388
+ return seconds;
389
+ };
390
+ /**
391
+ * Runs the caller's script in a new session. A script that fails comes back
392
+ * with Kernel's message as `error`, not thrown, with the billed time.
393
+ */
394
+ const runScript = async (raw, code, options = {}) => {
395
+ const { provider } = raw;
396
+ const { call, rest: o } = callSettings(options);
397
+ const seconds = scriptSeconds(provider, call.timeout);
398
+ const { billed, created, id, value } = await inSession(raw, o, call, async (session) => await raw.request("POST", `/browsers/${segment(session)}/playwright/execute`, {
399
+ ...call,
400
+ body: {
401
+ code,
402
+ timeout_sec: seconds
403
+ },
404
+ creates: true
405
+ }));
406
+ const body = z$1.parse(ExecuteResponse, value);
407
+ const failed = body.success !== true;
408
+ return compact({
409
+ error: failed ? body.error ?? "kernel reported that the script did not succeed" : void 0,
410
+ meta: sessionMeta(id, billed),
411
+ raw: {
412
+ browser: created,
413
+ execute: value
414
+ },
415
+ result: failed ? void 0 : body.result,
416
+ stderr: body.stderr ?? "",
417
+ stdout: body.stdout ?? ""
418
+ });
419
+ };
420
+ /**
421
+ * An adapter for Kernel: read, download, act and browser. Pass it to `fieldwork({ adapter })`.
377
422
  *
378
423
  * Throws `Unauthorized` when neither `apiKey` nor `KERNEL_API_KEY` is set.
379
424
  */
@@ -389,12 +434,13 @@ const kernel = (config = {}) => {
389
434
  return defineAdapter({
390
435
  name: provider,
391
436
  operations: {
437
+ act: async (code, options) => await runScript(raw, code, options),
392
438
  browser: {
393
- async close(id, options) {
439
+ async close(id, options = {}) {
394
440
  const { call } = callSettings(options);
395
441
  await raw.request("DELETE", `/browsers/${segment(id)}`, call);
396
442
  },
397
- async open(options) {
443
+ async open(options = {}) {
398
444
  const { call, rest: o } = callSettings(options);
399
445
  const response = await raw.request("POST", "/browsers", {
400
446
  creates: true,
@@ -408,7 +454,7 @@ const kernel = (config = {}) => {
408
454
  ...sessionBody(o)
409
455
  })
410
456
  });
411
- const session = z.parse(BrowserResponse, response);
457
+ const session = z$1.parse(BrowserResponse, response);
412
458
  return compact({
413
459
  cdpUrl: session.cdp_ws_url,
414
460
  id: requireJobId(provider, session.session_id),
@@ -1,4 +1,5 @@
1
- import { C as DocumentInput, T as DocumentUrl, W as ParsedDocument, a as RawClient, p as CallOptions, t as Adapter } from "./adapter-DQrBP1tj.js";
1
+ import { a as RawClient, t as Adapter } from "./adapter-J2yatZJ0.js";
2
+ import { H as ParsedDocument, l as CallOptions, x as DocumentUrl, y as DocumentInput } from "./errors-gMtejKHc.js";
2
3
  /** Settings for `llamaparse()`. */
3
4
  export interface LlamaParseConfig {
4
5
  /** Defaults to the LLAMA_CLOUD_API_KEY environment variable. */
@@ -58,7 +59,7 @@ export interface LlamaParseOperations {
58
59
  };
59
60
  }
60
61
  /**
61
- * An adapter for LlamaParse: parse. Pass it to `new Fieldwork({ adapter })`.
62
+ * An adapter for LlamaParse: parse. Pass it to `fieldwork({ adapter })`.
62
63
  *
63
64
  * Throws `Unauthorized` when neither `apiKey` nor `LLAMA_CLOUD_API_KEY` is set.
64
65
  */
@@ -1,10 +1,10 @@
1
- import { t as defineAdapter } from "./adapter-DWYJys20.js";
2
- import { i as enclosing, n as documentPart, o as refuseLarger, r as documentUrl } from "./document-DMIUCoDA.js";
3
- import { t as FieldworkError } from "./errors-DkFJysIM.js";
4
- import { C as createRawClient, E as segment, S as withOriginal, T as requireKey, a as looseObject, d as optionalId, f as optionalNumber, h as optionalString, m as optionalScalar, n as anything, r as arrayOf, s as optionalAnyString, w as readSigned } from "./parse-Q7H4mrnO.js";
5
- import { i as startJob, r as runJob, t as jobState } from "./job-DnavRq_s.js";
6
- import { a as compact, c as parseJson, s as meta, t as callSettings } from "./util-DFUXQX6v.js";
7
- import * as z from "zod/mini";
1
+ import { t as defineAdapter } from "./adapter-CBSAfErv.js";
2
+ import { i as enclosing, n as documentPart, o as refuseLarger, r as documentUrl } from "./document-BSCwJgBM.js";
3
+ import { t as FieldworkError } from "./errors-gpxg6Tnh.js";
4
+ import { O as withOriginal, _ as optionalId, b as optionalScalar, c as anything, d as looseObject, i as segment, l as arrayOf, n as readSigned, p as optionalAnyString, r as requireKey, t as createRawClient, v as optionalNumber, x as optionalString } from "./http-CJcvTPnE.js";
5
+ import { i as startJob, r as runJob, t as jobState } from "./job-JLEpszjr.js";
6
+ import { a as compact, c as parseJson, s as meta, t as callSettings } from "./util-LvME_uOj.js";
7
+ import * as z$1 from "zod/mini";
8
8
  // src/adapters/llamaparse/response.ts
9
9
  /** A box in page points, from the page's top-left corner. */
10
10
  const PointBox = looseObject({
@@ -16,17 +16,17 @@ const PointBox = looseObject({
16
16
  /** A word or a line: `span` is `[start, end)` in UTF-8 bytes of its item's `md`, or of its cell's text in a table. */
17
17
  const Word = looseObject({
18
18
  bbox: PointBox,
19
- span: arrayOf(z.number())
19
+ span: arrayOf(z$1.number())
20
20
  });
21
21
  const Line = looseObject({
22
22
  bbox: PointBox,
23
- span: arrayOf(z.number()),
23
+ span: arrayOf(z$1.number()),
24
24
  words: arrayOf(Word)
25
25
  });
26
- const OneBox = z.record(z.string(), z.unknown());
26
+ const OneBox = z$1.record(z$1.string(), z$1.unknown());
27
27
  const BoxList = arrayOf(PointBox);
28
28
  /** A list of boxes; one box on its own reads as a list of one, and anything else as none. */
29
- const PointBoxes = z.prefault(z.pipe(z.unknown(), z.transform((value) => z.parse(BoxList, z.safeParse(OneBox, value).success ? [value] : value))), []);
29
+ const PointBoxes = z$1.prefault(z$1.pipe(z$1.unknown(), z$1.transform((value) => z$1.parse(BoxList, z$1.safeParse(OneBox, value).success ? [value] : value))), []);
30
30
  const Cell = looseObject({
31
31
  bbox: PointBoxes,
32
32
  lines: arrayOf(Line)
@@ -135,7 +135,7 @@ const tableOf = (item, size) => {
135
135
  /** The page header or footer an item is, if it is one. */
136
136
  const containerOf = (item) => item.type === "header" || item.type === "footer" ? item.type : void 0;
137
137
  const blocksOfItem = (item, page, size, container) => {
138
- if (item.items.length > 0) return item.items.flatMap((child) => blocksOfItem(z.parse(Item, child), page, size, container ?? containerOf(item)));
138
+ if (item.items.length > 0) return item.items.flatMap((child) => blocksOfItem(z$1.parse(Item, child), page, size, container ?? containerOf(item)));
139
139
  const text = item.md ?? item.value ?? "";
140
140
  if (size === void 0) return [compact({
141
141
  container,
@@ -281,7 +281,7 @@ const parsedDocument = async (found, id, o, read, started) => {
281
281
  const grounded = o.wordBoxes === true ? await groundedPages(found, read) : void 0;
282
282
  const images = o.pageImages === true ? pageImageAddresses(found, id, started) : void 0;
283
283
  let laidOut;
284
- if (grounded !== void 0) laidOut = grounded.map((row) => z.parse(ItemsPage, row));
284
+ if (grounded !== void 0) laidOut = grounded.map((row) => z$1.parse(ItemsPage, row));
285
285
  else if (o.blocks === true) laidOut = found.value.items.pages;
286
286
  const sizes = laidOut === void 0 ? void 0 : pageSizes(laidOut);
287
287
  const pages = found.value.markdown.pages.flatMap((page) => {
@@ -324,7 +324,7 @@ const parse = async (raw, document, options, fetchImpl) => {
324
324
  ...o.pageImages === true ? ["images_content_metadata"] : []
325
325
  ].join(",");
326
326
  return await runJob(provider, {
327
- check: async (id, request) => finished(id, z.parse(JobResult, await raw.request("GET", `/api/v2/parse/${segment(id)}`, {
327
+ check: async (id, request) => finished(id, z$1.parse(JobResult, await raw.request("GET", `/api/v2/parse/${segment(id)}`, {
328
328
  ...request,
329
329
  query: { expand }
330
330
  }))),
@@ -343,7 +343,7 @@ const parse = async (raw, document, options, fetchImpl) => {
343
343
  });
344
344
  };
345
345
  /**
346
- * An adapter for LlamaParse: parse. Pass it to `new Fieldwork({ adapter })`.
346
+ * An adapter for LlamaParse: parse. Pass it to `fieldwork({ adapter })`.
347
347
  *
348
348
  * Throws `Unauthorized` when neither `apiKey` nor `LLAMA_CLOUD_API_KEY` is set.
349
349
  */
@@ -357,7 +357,7 @@ const llamaparse = (config = {}) => {
357
357
  });
358
358
  return defineAdapter({
359
359
  name: provider,
360
- operations: { async parse(first, options) {
360
+ operations: { async parse(first, options = {}) {
361
361
  return "resume" in first ? await parse(raw, void 0, first, config.fetch) : await parse(raw, first, options, config.fetch);
362
362
  } },
363
363
  raw
@@ -1,6 +1,6 @@
1
- import { $ as SearchResponse, B as MonitorInfo, H as Page, P as ImageSearch, U as PageBatch, V as MonitorSchedule, Z as Research, a as RawClient, b as Decisions, g as Condition, k as Extraction, l as Answer, p as CallOptions, t as Adapter, x as Discovery, y as DecisionQuestion, z as MonitorEvents } from "./adapter-DQrBP1tj.js";
2
- import { t as OutputSchema } from "./schema-BFjS6CSz.js";
3
- import "./util-DhYr1OS3.js";
1
+ import { a as RawClient, t as Adapter } from "./adapter-J2yatZJ0.js";
2
+ import { B as Page, L as MonitorEvents, Q as SearchResponse, R as MonitorInfo, T as Extraction, V as PageBatch, Y as Research, _ as Discovery, a as Answer, at as JsonObject, f as Condition, g as Decisions, h as DecisionQuestion, j as ImageSearch, l as CallOptions, ot as JsonValue, z as MonitorSchedule } from "./errors-gMtejKHc.js";
3
+ import { t as OutputSchema } from "./schema-C9xzRkKJ.js";
4
4
  /** Settings for `parallel()`. */
5
5
  interface ParallelConfig {
6
6
  /** Defaults to the PARALLEL_API_KEY environment variable. */
@@ -63,7 +63,7 @@ interface ParallelSearchOptions extends CallOptions, ParallelSources {
63
63
  interface ParallelImagesOptions extends CallOptions {
64
64
  /** The images wanted, in plain words, up to 5,000 characters. Defaults to the query. */
65
65
  objective?: string;
66
- /** Up to 5 image queries; defaults to the query alone. */
66
+ /** Up to 3 image queries (Parallel uses only the first 3); defaults to the query alone. */
67
67
  queries?: string[];
68
68
  mode?: "fast" | "advanced";
69
69
  /** Sent as `max_results`. */
@@ -181,7 +181,7 @@ interface ParallelResearchOptions<T = unknown> extends CallOptions, ParallelSour
181
181
  * least one match returns `status: "partial"`; one that ends with no match throws
182
182
  * `JobFailed`.
183
183
  */
184
- interface ParallelDiscoverOptions<T = unknown> extends CallOptions {
184
+ interface ParallelDiscoverOptions<T = JsonObject> extends CallOptions {
185
185
  /** What kind of entity to find, such as "companies" or "people". */
186
186
  entityType: string;
187
187
  /** Every discovered entity is tested against all of these. */
@@ -199,7 +199,7 @@ interface ParallelDiscoverOptions<T = unknown> extends CallOptions {
199
199
  * Fills these fields for every match (Parallel's enrichment, run as a Task
200
200
  * after the run starts), returned in each entity's `data`.
201
201
  */
202
- schema?: OutputSchema<T>;
202
+ schema?: OutputSchema<T, JsonObject>;
203
203
  /** The Task processor that fills `schema`. Parallel defaults to "core". */
204
204
  processor?: ParallelProcessor;
205
205
  metadata?: ParallelMetadata;
@@ -296,8 +296,8 @@ interface ParallelOperations {
296
296
  extract: <T = unknown>(url: string, options?: ParallelExtractOptions<T>) => Promise<Extraction<T>>;
297
297
  answer: <T = unknown>(question: string, options?: ParallelAnswerOptions<T>) => Promise<Answer<T>>;
298
298
  research: <T = unknown>(question: string, options?: ParallelResearchOptions<T>) => Promise<Research<T>>;
299
- discover: <T = Record<string, unknown>>(objective: string, options: ParallelDiscoverOptions<T>) => Promise<ParallelDiscovery<T>>;
300
- decide: (context: unknown, questions: Record<string, DecisionQuestion>, options?: ParallelDecideOptions) => Promise<Decisions>;
299
+ discover: <T = JsonObject>(objective: string, options: ParallelDiscoverOptions<T>) => Promise<ParallelDiscovery<T>>;
300
+ decide: (context: JsonValue, questions: Record<string, DecisionQuestion>, options?: ParallelDecideOptions) => Promise<Decisions>;
301
301
  monitor: {
302
302
  create: (options: ParallelMonitorCreateOptions) => Promise<MonitorInfo>;
303
303
  get: (id: string, options?: CallOptions) => Promise<MonitorInfo>;
@@ -308,7 +308,7 @@ interface ParallelOperations {
308
308
  };
309
309
  }
310
310
  /**
311
- * An adapter for Parallel: search, images, read, readMany, extract, answer, research, discover, decide and monitor. Pass it to `new Fieldwork({ adapter })`.
311
+ * An adapter for Parallel: search, images, read, readMany, extract, answer, research, discover, decide and monitor. Pass it to `fieldwork({ adapter })`.
312
312
  *
313
313
  * Throws `Unauthorized` when neither `apiKey` nor `PARALLEL_API_KEY` is set.
314
314
  */