parallel-web 0.4.1 → 1.0.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 (241) hide show
  1. package/CHANGELOG.md +54 -0
  2. package/api-promise.d.mts +1 -0
  3. package/api-promise.d.mts.map +1 -1
  4. package/api-promise.d.ts +1 -0
  5. package/api-promise.d.ts.map +1 -1
  6. package/api-promise.mjs +1 -0
  7. package/api-promise.mjs.map +1 -1
  8. package/client.d.mts +29 -8
  9. package/client.d.mts.map +1 -1
  10. package/client.d.ts +29 -8
  11. package/client.d.ts.map +1 -1
  12. package/client.js +34 -4
  13. package/client.js.map +1 -1
  14. package/client.mjs +34 -4
  15. package/client.mjs.map +1 -1
  16. package/core/api-promise.d.mts.map +1 -1
  17. package/core/api-promise.d.ts.map +1 -1
  18. package/core/api-promise.mjs.map +1 -1
  19. package/core/error.mjs.map +1 -1
  20. package/core/resource.d.mts.map +1 -1
  21. package/core/resource.d.ts.map +1 -1
  22. package/core/streaming.d.mts.map +1 -1
  23. package/core/streaming.d.ts.map +1 -1
  24. package/core/streaming.mjs.map +1 -1
  25. package/core/uploads.d.mts.map +1 -1
  26. package/core/uploads.d.ts.map +1 -1
  27. package/core/uploads.mjs.map +1 -1
  28. package/error.d.mts +1 -0
  29. package/error.d.mts.map +1 -1
  30. package/error.d.ts +1 -0
  31. package/error.d.ts.map +1 -1
  32. package/error.mjs +1 -0
  33. package/error.mjs.map +1 -1
  34. package/index.d.mts.map +1 -1
  35. package/index.d.ts.map +1 -1
  36. package/index.mjs.map +1 -1
  37. package/internal/decoders/line.mjs.map +1 -1
  38. package/internal/detect-platform.mjs.map +1 -1
  39. package/internal/headers.mjs.map +1 -1
  40. package/internal/parse.d.mts.map +1 -1
  41. package/internal/parse.d.ts.map +1 -1
  42. package/internal/parse.mjs.map +1 -1
  43. package/internal/qs/formats.d.mts +7 -0
  44. package/internal/qs/formats.d.mts.map +1 -0
  45. package/internal/qs/formats.d.ts +7 -0
  46. package/internal/qs/formats.d.ts.map +1 -0
  47. package/internal/qs/formats.js +13 -0
  48. package/internal/qs/formats.js.map +1 -0
  49. package/internal/qs/formats.mjs +9 -0
  50. package/internal/qs/formats.mjs.map +1 -0
  51. package/internal/qs/index.d.mts +10 -0
  52. package/internal/qs/index.d.mts.map +1 -0
  53. package/internal/qs/index.d.ts +10 -0
  54. package/internal/qs/index.d.ts.map +1 -0
  55. package/internal/qs/index.js +14 -0
  56. package/internal/qs/index.js.map +1 -0
  57. package/internal/qs/index.mjs +10 -0
  58. package/internal/qs/index.mjs.map +1 -0
  59. package/internal/qs/stringify.d.mts +3 -0
  60. package/internal/qs/stringify.d.mts.map +1 -0
  61. package/internal/qs/stringify.d.ts +3 -0
  62. package/internal/qs/stringify.d.ts.map +1 -0
  63. package/internal/qs/stringify.js +277 -0
  64. package/internal/qs/stringify.js.map +1 -0
  65. package/internal/qs/stringify.mjs +274 -0
  66. package/internal/qs/stringify.mjs.map +1 -0
  67. package/internal/qs/types.d.mts +57 -0
  68. package/internal/qs/types.d.mts.map +1 -0
  69. package/internal/qs/types.d.ts +57 -0
  70. package/internal/qs/types.d.ts.map +1 -0
  71. package/internal/qs/types.js +3 -0
  72. package/internal/qs/types.js.map +1 -0
  73. package/internal/qs/types.mjs +2 -0
  74. package/internal/qs/types.mjs.map +1 -0
  75. package/internal/qs/utils.d.mts +15 -0
  76. package/internal/qs/utils.d.mts.map +1 -0
  77. package/internal/qs/utils.d.ts +15 -0
  78. package/internal/qs/utils.d.ts.map +1 -0
  79. package/internal/qs/utils.js +230 -0
  80. package/internal/qs/utils.js.map +1 -0
  81. package/internal/qs/utils.mjs +217 -0
  82. package/internal/qs/utils.mjs.map +1 -0
  83. package/internal/request-options.d.mts.map +1 -1
  84. package/internal/request-options.d.ts.map +1 -1
  85. package/internal/shims.d.mts +6 -0
  86. package/internal/shims.d.mts.map +1 -1
  87. package/internal/shims.d.ts +6 -0
  88. package/internal/shims.d.ts.map +1 -1
  89. package/internal/to-file.d.mts.map +1 -1
  90. package/internal/to-file.d.ts.map +1 -1
  91. package/internal/to-file.mjs.map +1 -1
  92. package/internal/types.d.mts +10 -10
  93. package/internal/types.d.mts.map +1 -1
  94. package/internal/types.d.ts +10 -10
  95. package/internal/types.d.ts.map +1 -1
  96. package/internal/uploads.d.mts.map +1 -1
  97. package/internal/uploads.d.ts.map +1 -1
  98. package/internal/uploads.mjs.map +1 -1
  99. package/internal/utils/base64.mjs.map +1 -1
  100. package/internal/utils/log.d.mts.map +1 -1
  101. package/internal/utils/log.d.ts.map +1 -1
  102. package/internal/utils/log.js +3 -2
  103. package/internal/utils/log.js.map +1 -1
  104. package/internal/utils/log.mjs +3 -2
  105. package/internal/utils/log.mjs.map +1 -1
  106. package/internal/utils/path.mjs.map +1 -1
  107. package/internal/utils/query.d.mts +0 -3
  108. package/internal/utils/query.d.mts.map +1 -1
  109. package/internal/utils/query.d.ts +0 -3
  110. package/internal/utils/query.d.ts.map +1 -1
  111. package/internal/utils/query.js +3 -16
  112. package/internal/utils/query.js.map +1 -1
  113. package/internal/utils/query.mjs +2 -16
  114. package/internal/utils/query.mjs.map +1 -1
  115. package/internal/utils/values.mjs.map +1 -1
  116. package/internal/utils.d.mts.map +1 -1
  117. package/internal/utils.d.ts.map +1 -1
  118. package/internal/utils.mjs.map +1 -1
  119. package/package.json +1 -1
  120. package/resource.d.mts +1 -0
  121. package/resource.d.mts.map +1 -1
  122. package/resource.d.ts +1 -0
  123. package/resource.d.ts.map +1 -1
  124. package/resource.mjs +1 -0
  125. package/resource.mjs.map +1 -1
  126. package/resources/beta/beta.d.mts +2 -270
  127. package/resources/beta/beta.d.mts.map +1 -1
  128. package/resources/beta/beta.d.ts +2 -270
  129. package/resources/beta/beta.d.ts.map +1 -1
  130. package/resources/beta/beta.js +0 -39
  131. package/resources/beta/beta.js.map +1 -1
  132. package/resources/beta/beta.mjs +0 -39
  133. package/resources/beta/beta.mjs.map +1 -1
  134. package/resources/beta/findall.d.mts +202 -247
  135. package/resources/beta/findall.d.mts.map +1 -1
  136. package/resources/beta/findall.d.ts +202 -247
  137. package/resources/beta/findall.d.ts.map +1 -1
  138. package/resources/beta/findall.js +28 -27
  139. package/resources/beta/findall.js.map +1 -1
  140. package/resources/beta/findall.mjs +28 -27
  141. package/resources/beta/findall.mjs.map +1 -1
  142. package/resources/beta/index.d.mts +1 -3
  143. package/resources/beta/index.d.mts.map +1 -1
  144. package/resources/beta/index.d.ts +1 -3
  145. package/resources/beta/index.d.ts.map +1 -1
  146. package/resources/beta/index.js +1 -5
  147. package/resources/beta/index.js.map +1 -1
  148. package/resources/beta/index.mjs +0 -2
  149. package/resources/beta/index.mjs.map +1 -1
  150. package/resources/beta.d.mts.map +1 -1
  151. package/resources/beta.d.ts.map +1 -1
  152. package/resources/beta.mjs.map +1 -1
  153. package/resources/index.d.mts +4 -2
  154. package/resources/index.d.mts.map +1 -1
  155. package/resources/index.d.ts +4 -2
  156. package/resources/index.d.ts.map +1 -1
  157. package/resources/index.js +5 -1
  158. package/resources/index.js.map +1 -1
  159. package/resources/index.mjs +2 -0
  160. package/resources/index.mjs.map +1 -1
  161. package/resources/monitor.d.mts +625 -0
  162. package/resources/monitor.d.mts.map +1 -0
  163. package/resources/monitor.d.ts +625 -0
  164. package/resources/monitor.d.ts.map +1 -0
  165. package/resources/monitor.js +140 -0
  166. package/resources/monitor.js.map +1 -0
  167. package/resources/monitor.mjs +136 -0
  168. package/resources/monitor.mjs.map +1 -0
  169. package/resources/{beta/task-group.d.mts → task-group.d.mts} +38 -68
  170. package/resources/task-group.d.mts.map +1 -0
  171. package/resources/{beta/task-group.d.ts → task-group.d.ts} +38 -68
  172. package/resources/task-group.d.ts.map +1 -0
  173. package/resources/{beta/task-group.js → task-group.js} +24 -64
  174. package/resources/task-group.js.map +1 -0
  175. package/resources/{beta/task-group.mjs → task-group.mjs} +24 -64
  176. package/resources/task-group.mjs.map +1 -0
  177. package/resources/task-run.d.mts +100 -83
  178. package/resources/task-run.d.mts.map +1 -1
  179. package/resources/task-run.d.ts +100 -83
  180. package/resources/task-run.d.ts.map +1 -1
  181. package/resources/task-run.js +14 -1
  182. package/resources/task-run.js.map +1 -1
  183. package/resources/task-run.mjs +14 -1
  184. package/resources/task-run.mjs.map +1 -1
  185. package/resources/top-level.d.mts +20 -16
  186. package/resources/top-level.d.mts.map +1 -1
  187. package/resources/top-level.d.ts +20 -16
  188. package/resources/top-level.d.ts.map +1 -1
  189. package/resources.d.mts.map +1 -1
  190. package/resources.d.ts.map +1 -1
  191. package/resources.mjs.map +1 -1
  192. package/src/client.ts +120 -4
  193. package/src/internal/qs/LICENSE.md +13 -0
  194. package/src/internal/qs/README.md +3 -0
  195. package/src/internal/qs/formats.ts +10 -0
  196. package/src/internal/qs/index.ts +13 -0
  197. package/src/internal/qs/stringify.ts +385 -0
  198. package/src/internal/qs/types.ts +71 -0
  199. package/src/internal/qs/utils.ts +265 -0
  200. package/src/internal/types.ts +6 -8
  201. package/src/internal/utils/log.ts +2 -1
  202. package/src/internal/utils/query.ts +2 -18
  203. package/src/resources/beta/api.md +9 -59
  204. package/src/resources/beta/beta.ts +16 -406
  205. package/src/resources/beta/findall.ts +252 -284
  206. package/src/resources/beta/index.ts +8 -30
  207. package/src/resources/index.ts +42 -0
  208. package/src/resources/monitor.ts +752 -0
  209. package/src/resources/{beta/task-group.ts → task-group.ts} +58 -93
  210. package/src/resources/task-run.ts +125 -98
  211. package/src/resources/top-level.ts +24 -16
  212. package/src/version.ts +1 -1
  213. package/streaming.d.mts +1 -0
  214. package/streaming.d.mts.map +1 -1
  215. package/streaming.d.ts +1 -0
  216. package/streaming.d.ts.map +1 -1
  217. package/streaming.mjs +1 -0
  218. package/streaming.mjs.map +1 -1
  219. package/uploads.d.mts +1 -0
  220. package/uploads.d.mts.map +1 -1
  221. package/uploads.d.ts +1 -0
  222. package/uploads.d.ts.map +1 -1
  223. package/uploads.mjs +1 -0
  224. package/uploads.mjs.map +1 -1
  225. package/version.d.mts +1 -1
  226. package/version.d.ts +1 -1
  227. package/version.js +1 -1
  228. package/version.mjs +1 -1
  229. package/resources/beta/task-group.d.mts.map +0 -1
  230. package/resources/beta/task-group.d.ts.map +0 -1
  231. package/resources/beta/task-group.js.map +0 -1
  232. package/resources/beta/task-group.mjs.map +0 -1
  233. package/resources/beta/task-run.d.mts +0 -239
  234. package/resources/beta/task-run.d.mts.map +0 -1
  235. package/resources/beta/task-run.d.ts +0 -239
  236. package/resources/beta/task-run.d.ts.map +0 -1
  237. package/resources/beta/task-run.js +0 -81
  238. package/resources/beta/task-run.js.map +0 -1
  239. package/resources/beta/task-run.mjs +0 -77
  240. package/resources/beta/task-run.mjs.map +0 -1
  241. package/src/resources/beta/task-run.ts +0 -336
@@ -1,77 +0,0 @@
1
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
- import { APIResource } from "../../core/resource.mjs";
3
- import { buildHeaders } from "../../internal/headers.mjs";
4
- import { path } from "../../internal/utils/path.mjs";
5
- /**
6
- * The Task API executes web research and extraction tasks. Clients submit a natural-language objective with an optional input schema; the service plans retrieval, fetches relevant URLs, and returns outputs that conform to a provided or inferred JSON schema. Supports deep research style queries and can return rich structured JSON outputs. Processors trade-off between cost, latency, and quality. Each processor supports calibrated confidences.
7
- * - Output metadata: citations, excerpts, reasoning, and confidence per field
8
- *
9
- * Task Groups enable batch execution of many independent Task runs with group-level monitoring and failure handling.
10
- * - Submit hundreds or thousands of Tasks as a single group
11
- * - Observe group progress and receive results as they complete
12
- * - Real-time updates via Server-Sent Events (SSE)
13
- * - Add tasks to an existing group while it is running
14
- * - Group-level retry and error aggregation
15
- *
16
- * @deprecated Use GA Task Run instead
17
- */
18
- export class TaskRun extends APIResource {
19
- /**
20
- * Initiates a task run.
21
- *
22
- * Returns immediately with a run object in status 'queued'.
23
- *
24
- * Beta features can be enabled by setting the 'parallel-beta' header.
25
- *
26
- * @deprecated Use GA Task Run instead
27
- */
28
- create(params, options) {
29
- const { betas, ...body } = params;
30
- return this._client.post('/v1/tasks/runs', {
31
- body,
32
- ...options,
33
- headers: buildHeaders([
34
- { 'parallel-beta': [...(betas ?? []), 'search-extract-2025-10-10'].toString() },
35
- options?.headers,
36
- ]),
37
- });
38
- }
39
- /**
40
- * Streams events for a task run.
41
- *
42
- * Returns a stream of events showing progress updates and state changes for the
43
- * task run.
44
- *
45
- * For task runs that did not have enable_events set to true during creation, the
46
- * frequency of events will be reduced.
47
- *
48
- * @deprecated Use GA Task Run instead
49
- */
50
- events(runID, options) {
51
- return this._client.get(path `/v1beta/tasks/runs/${runID}/events`, {
52
- ...options,
53
- headers: buildHeaders([
54
- { 'parallel-beta': 'search-extract-2025-10-10', Accept: 'text/event-stream' },
55
- options?.headers,
56
- ]),
57
- stream: true,
58
- });
59
- }
60
- /**
61
- * Retrieves a run result by run_id, blocking until the run is completed.
62
- *
63
- * @deprecated Use GA Task Run instead
64
- */
65
- result(runID, params = {}, options) {
66
- const { betas, ...query } = params ?? {};
67
- return this._client.get(path `/v1/tasks/runs/${runID}/result`, {
68
- query,
69
- ...options,
70
- headers: buildHeaders([
71
- { 'parallel-beta': [...(betas ?? []), 'search-extract-2025-10-10'].toString() },
72
- options?.headers,
73
- ]),
74
- });
75
- }
76
- }
77
- //# sourceMappingURL=task-run.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"task-run.mjs","sourceRoot":"","sources":["../../src/resources/beta/task-run.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAKf,EAAE,YAAY,EAAE;OAEhB,EAAE,IAAI,EAAE;AAEf;;;;;;;;;;;;GAYG;AACH,MAAM,OAAO,OAAQ,SAAQ,WAAW;IACtC;;;;;;;;OAQG;IACH,MAAM,CAAC,MAA2B,EAAE,OAAwB;QAC1D,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QAClC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE;YACzC,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC;gBACpB,EAAE,eAAe,EAAE,CAAC,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC,EAAE,2BAA2B,CAAC,CAAC,QAAQ,EAAE,EAAE;gBAC/E,OAAO,EAAE,OAAO;aACjB,CAAC;SACH,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;OAUG;IACH,MAAM,CAAC,KAAa,EAAE,OAAwB;QAC5C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,sBAAsB,KAAK,SAAS,EAAE;YAChE,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC;gBACpB,EAAE,eAAe,EAAE,2BAA2B,EAAE,MAAM,EAAE,mBAAmB,EAAE;gBAC7E,OAAO,EAAE,OAAO;aACjB,CAAC;YACF,MAAM,EAAE,IAAI;SACb,CAA8C,CAAC;IAClD,CAAC;IAED;;;;OAIG;IACH,MAAM,CACJ,KAAa,EACb,SAAiD,EAAE,EACnD,OAAwB;QAExB,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,GAAG,MAAM,IAAI,EAAE,CAAC;QACzC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,kBAAkB,KAAK,SAAS,EAAE;YAC5D,KAAK;YACL,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC;gBACpB,EAAE,eAAe,EAAE,CAAC,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC,EAAE,2BAA2B,CAAC,CAAC,QAAQ,EAAE,EAAE;gBAC/E,OAAO,EAAE,OAAO;aACjB,CAAC;SACH,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -1,336 +0,0 @@
1
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
- import { APIResource } from '../../core/resource';
4
- import * as Shared from '../shared';
5
- import * as TaskRunAPI from '../task-run';
6
- import { APIPromise } from '../../core/api-promise';
7
- import { Stream } from '../../core/streaming';
8
- import { buildHeaders } from '../../internal/headers';
9
- import { RequestOptions } from '../../internal/request-options';
10
- import { path } from '../../internal/utils/path';
11
-
12
- /**
13
- * The Task API executes web research and extraction tasks. Clients submit a natural-language objective with an optional input schema; the service plans retrieval, fetches relevant URLs, and returns outputs that conform to a provided or inferred JSON schema. Supports deep research style queries and can return rich structured JSON outputs. Processors trade-off between cost, latency, and quality. Each processor supports calibrated confidences.
14
- * - Output metadata: citations, excerpts, reasoning, and confidence per field
15
- *
16
- * Task Groups enable batch execution of many independent Task runs with group-level monitoring and failure handling.
17
- * - Submit hundreds or thousands of Tasks as a single group
18
- * - Observe group progress and receive results as they complete
19
- * - Real-time updates via Server-Sent Events (SSE)
20
- * - Add tasks to an existing group while it is running
21
- * - Group-level retry and error aggregation
22
- *
23
- * @deprecated Use GA Task Run instead
24
- */
25
- export class TaskRun extends APIResource {
26
- /**
27
- * Initiates a task run.
28
- *
29
- * Returns immediately with a run object in status 'queued'.
30
- *
31
- * Beta features can be enabled by setting the 'parallel-beta' header.
32
- *
33
- * @deprecated Use GA Task Run instead
34
- */
35
- create(params: TaskRunCreateParams, options?: RequestOptions): APIPromise<TaskRunAPI.TaskRun> {
36
- const { betas, ...body } = params;
37
- return this._client.post('/v1/tasks/runs', {
38
- body,
39
- ...options,
40
- headers: buildHeaders([
41
- { 'parallel-beta': [...(betas ?? []), 'search-extract-2025-10-10'].toString() },
42
- options?.headers,
43
- ]),
44
- });
45
- }
46
-
47
- /**
48
- * Streams events for a task run.
49
- *
50
- * Returns a stream of events showing progress updates and state changes for the
51
- * task run.
52
- *
53
- * For task runs that did not have enable_events set to true during creation, the
54
- * frequency of events will be reduced.
55
- *
56
- * @deprecated Use GA Task Run instead
57
- */
58
- events(runID: string, options?: RequestOptions): APIPromise<Stream<TaskRunEventsResponse>> {
59
- return this._client.get(path`/v1beta/tasks/runs/${runID}/events`, {
60
- ...options,
61
- headers: buildHeaders([
62
- { 'parallel-beta': 'search-extract-2025-10-10', Accept: 'text/event-stream' },
63
- options?.headers,
64
- ]),
65
- stream: true,
66
- }) as APIPromise<Stream<TaskRunEventsResponse>>;
67
- }
68
-
69
- /**
70
- * Retrieves a run result by run_id, blocking until the run is completed.
71
- *
72
- * @deprecated Use GA Task Run instead
73
- */
74
- result(
75
- runID: string,
76
- params: TaskRunResultParams | null | undefined = {},
77
- options?: RequestOptions,
78
- ): APIPromise<TaskRunAPI.TaskRunResult> {
79
- const { betas, ...query } = params ?? {};
80
- return this._client.get(path`/v1/tasks/runs/${runID}/result`, {
81
- query,
82
- ...options,
83
- headers: buildHeaders([
84
- { 'parallel-beta': [...(betas ?? []), 'search-extract-2025-10-10'].toString() },
85
- options?.headers,
86
- ]),
87
- });
88
- }
89
- }
90
-
91
- /**
92
- * Model for the parallel-beta header.
93
- */
94
- export type ParallelBeta =
95
- | 'mcp-server-2025-07-17'
96
- | 'events-sse-2025-07-24'
97
- | 'webhook-2025-08-12'
98
- | 'findall-2025-09-15'
99
- | 'search-extract-2025-10-10'
100
- | 'field-basis-2025-11-25'
101
- | (string & {});
102
-
103
- /**
104
- * A progress update for a task run.
105
- */
106
- export type TaskRunEventsResponse =
107
- | TaskRunEventsResponse.TaskRunProgressStatsEvent
108
- | TaskRunEventsResponse.TaskRunProgressMessageEvent
109
- | TaskRunAPI.TaskRunEvent
110
- | TaskRunAPI.ErrorEvent;
111
-
112
- export namespace TaskRunEventsResponse {
113
- /**
114
- * A progress update for a task run.
115
- */
116
- export interface TaskRunProgressStatsEvent {
117
- /**
118
- * Completion percentage of the task run. Ranges from 0 to 100 where 0 indicates no
119
- * progress and 100 indicates completion.
120
- */
121
- progress_meter: number;
122
-
123
- /**
124
- * Source stats describing progress so far.
125
- */
126
- source_stats: TaskRunProgressStatsEvent.SourceStats;
127
-
128
- /**
129
- * Event type; always 'task_run.progress_stats'.
130
- */
131
- type: 'task_run.progress_stats';
132
- }
133
-
134
- export namespace TaskRunProgressStatsEvent {
135
- /**
136
- * Source stats describing progress so far.
137
- */
138
- export interface SourceStats {
139
- /**
140
- * Number of sources considered in processing the task.
141
- */
142
- num_sources_considered: number | null;
143
-
144
- /**
145
- * Number of sources read in processing the task.
146
- */
147
- num_sources_read: number | null;
148
-
149
- /**
150
- * A sample of URLs of sources read in processing the task.
151
- */
152
- sources_read_sample: Array<string> | null;
153
- }
154
- }
155
-
156
- /**
157
- * A message for a task run progress update.
158
- */
159
- export interface TaskRunProgressMessageEvent {
160
- /**
161
- * Progress update message.
162
- */
163
- message: string;
164
-
165
- /**
166
- * Timestamp of the message.
167
- */
168
- timestamp: string | null;
169
-
170
- /**
171
- * Event type; always starts with 'task_run.progress_msg'.
172
- */
173
- type:
174
- | 'task_run.progress_msg.plan'
175
- | 'task_run.progress_msg.search'
176
- | 'task_run.progress_msg.result'
177
- | 'task_run.progress_msg.tool_call'
178
- | 'task_run.progress_msg.exec_status';
179
- }
180
- }
181
-
182
- /**
183
- * @deprecated Use parallel.types.task_run.TaskRunInput instead
184
- */
185
- export type BetaRunInput = TaskRunAPI.RunInput;
186
-
187
- /**
188
- * @deprecated Use parallel.types.task_run.TaskRunResult instead
189
- */
190
- export type BetaTaskRunResult = TaskRunAPI.TaskRunResult;
191
-
192
- /**
193
- * Backwards-compatible namespace for `BetaTaskRunResult`.
194
- * @deprecated Use `TaskRunJsonOutput` and `TaskRunTextOutput` from `task-run` instead.
195
- */
196
- export namespace BetaTaskRunResult {
197
- /** @deprecated Use `TaskRunAPI.TaskRunTextOutput` instead */
198
- export type BetaTaskRunTextOutput = TaskRunAPI.TaskRunTextOutput;
199
- /** @deprecated Use `TaskRunAPI.TaskRunJsonOutput` instead */
200
- export type BetaTaskRunJsonOutput = TaskRunAPI.TaskRunJsonOutput;
201
- }
202
-
203
- /**
204
- * @deprecated Use parallel.types.task_run.Webhook instead
205
- */
206
- export type Webhook = TaskRunAPI.Webhook;
207
-
208
- /**
209
- * @deprecated Use parallel.types.task_run.McpServer instead
210
- */
211
- export type McpServer = TaskRunAPI.McpServer;
212
-
213
- /**
214
- * @deprecated Use parallel.types.task_run.McpToolCall instead
215
- */
216
- export type McpToolCall = TaskRunAPI.McpToolCall;
217
-
218
- /**
219
- * @deprecated Use parallel.types.task_run.TaskRunEvent instead
220
- */
221
- export type TaskRunEvent = TaskRunAPI.TaskRunEvent;
222
-
223
- /**
224
- * @deprecated Use parallel.types.task_run.ErrorEvent instead
225
- */
226
- export type ErrorEvent = TaskRunAPI.ErrorEvent;
227
-
228
- export interface TaskRunCreateParams {
229
- /**
230
- * Body param: Input to the task, either text or a JSON object.
231
- */
232
- input: string | { [key: string]: unknown };
233
-
234
- /**
235
- * Body param: Processor to use for the task.
236
- */
237
- processor: string;
238
-
239
- /**
240
- * Body param: Advanced search configuration for a task run.
241
- */
242
- advanced_settings?: TaskRunCreateParams.AdvancedSettings | null;
243
-
244
- /**
245
- * Body param: Controls tracking of task run execution progress. When set to true,
246
- * progress events are recorded and can be accessed via the
247
- * [Task Run events](https://docs.parallel.ai/api-reference) endpoint. When false,
248
- * no progress events are tracked. Note that progress tracking cannot be enabled
249
- * after a run has been created. The flag is set to true by default for premium
250
- * processors (pro and above).
251
- */
252
- enable_events?: boolean | null;
253
-
254
- /**
255
- * Body param: Optional list of MCP servers to use for the run.
256
- */
257
- mcp_servers?: Array<TaskRunAPI.McpServer> | null;
258
-
259
- /**
260
- * Body param: User-provided metadata stored with the run. Keys and values must be
261
- * strings with a maximum length of 16 and 512 characters respectively.
262
- */
263
- metadata?: { [key: string]: string | number | boolean } | null;
264
-
265
- /**
266
- * Body param: Interaction ID to use as context for this request.
267
- */
268
- previous_interaction_id?: string | null;
269
-
270
- /**
271
- * Body param: Source policy for web search results.
272
- *
273
- * This policy governs which sources are allowed/disallowed in results.
274
- */
275
- source_policy?: Shared.SourcePolicy | null;
276
-
277
- /**
278
- * Body param: Specification for a task.
279
- *
280
- * Auto output schemas can be specified by setting `output_schema={"type":"auto"}`.
281
- * Not specifying a TaskSpec is the same as setting an auto output schema.
282
- *
283
- * For convenience bare strings are also accepted as input or output schemas.
284
- */
285
- task_spec?: TaskRunAPI.TaskSpec | null;
286
-
287
- /**
288
- * Body param: Webhooks for Task Runs.
289
- */
290
- webhook?: TaskRunAPI.Webhook | null;
291
-
292
- /**
293
- * Header param: Optional header to specify the beta version(s) to enable.
294
- */
295
- betas?: Array<ParallelBeta>;
296
- }
297
-
298
- export namespace TaskRunCreateParams {
299
- /**
300
- * Advanced search configuration for a task run.
301
- */
302
- export interface AdvancedSettings {
303
- /**
304
- * ISO 3166-1 alpha-2 country code for geo-targeted search results.
305
- */
306
- location?: string | null;
307
- }
308
- }
309
-
310
- export interface TaskRunResultParams {
311
- /**
312
- * Query param
313
- */
314
- timeout?: number;
315
-
316
- /**
317
- * Header param: Optional header to specify the beta version(s) to enable.
318
- */
319
- betas?: Array<ParallelBeta>;
320
- }
321
-
322
- export declare namespace TaskRun {
323
- export {
324
- type ParallelBeta as ParallelBeta,
325
- type TaskRunEventsResponse as TaskRunEventsResponse,
326
- type BetaRunInput as BetaRunInput,
327
- type BetaTaskRunResult as BetaTaskRunResult,
328
- type Webhook as Webhook,
329
- type McpServer as McpServer,
330
- type McpToolCall as McpToolCall,
331
- type TaskRunEvent as TaskRunEvent,
332
- type ErrorEvent as ErrorEvent,
333
- type TaskRunCreateParams as TaskRunCreateParams,
334
- type TaskRunResultParams as TaskRunResultParams,
335
- };
336
- }