parallel-web 0.5.0 → 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 (179) hide show
  1. package/CHANGELOG.md +28 -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.map +1 -1
  9. package/client.d.ts.map +1 -1
  10. package/client.mjs.map +1 -1
  11. package/core/api-promise.d.mts.map +1 -1
  12. package/core/api-promise.d.ts.map +1 -1
  13. package/core/api-promise.mjs.map +1 -1
  14. package/core/error.mjs.map +1 -1
  15. package/core/resource.d.mts.map +1 -1
  16. package/core/resource.d.ts.map +1 -1
  17. package/core/streaming.d.mts.map +1 -1
  18. package/core/streaming.d.ts.map +1 -1
  19. package/core/streaming.mjs.map +1 -1
  20. package/core/uploads.d.mts.map +1 -1
  21. package/core/uploads.d.ts.map +1 -1
  22. package/core/uploads.mjs.map +1 -1
  23. package/error.d.mts +1 -0
  24. package/error.d.mts.map +1 -1
  25. package/error.d.ts +1 -0
  26. package/error.d.ts.map +1 -1
  27. package/error.mjs +1 -0
  28. package/error.mjs.map +1 -1
  29. package/index.d.mts.map +1 -1
  30. package/index.d.ts.map +1 -1
  31. package/index.mjs.map +1 -1
  32. package/internal/decoders/line.mjs.map +1 -1
  33. package/internal/detect-platform.mjs.map +1 -1
  34. package/internal/headers.mjs.map +1 -1
  35. package/internal/parse.d.mts.map +1 -1
  36. package/internal/parse.d.ts.map +1 -1
  37. package/internal/parse.mjs.map +1 -1
  38. package/internal/qs/formats.d.mts.map +1 -1
  39. package/internal/qs/formats.d.ts.map +1 -1
  40. package/internal/qs/index.d.mts +2 -2
  41. package/internal/qs/index.d.mts.map +1 -1
  42. package/internal/qs/index.d.ts +2 -2
  43. package/internal/qs/index.d.ts.map +1 -1
  44. package/internal/qs/index.mjs.map +1 -1
  45. package/internal/qs/stringify.d.mts.map +1 -1
  46. package/internal/qs/stringify.d.ts.map +1 -1
  47. package/internal/qs/stringify.mjs.map +1 -1
  48. package/internal/qs/utils.d.mts.map +1 -1
  49. package/internal/qs/utils.d.ts.map +1 -1
  50. package/internal/qs/utils.mjs.map +1 -1
  51. package/internal/request-options.d.mts.map +1 -1
  52. package/internal/request-options.d.ts.map +1 -1
  53. package/internal/shims.d.mts +6 -0
  54. package/internal/shims.d.mts.map +1 -1
  55. package/internal/shims.d.ts +6 -0
  56. package/internal/shims.d.ts.map +1 -1
  57. package/internal/to-file.d.mts.map +1 -1
  58. package/internal/to-file.d.ts.map +1 -1
  59. package/internal/to-file.mjs.map +1 -1
  60. package/internal/types.d.mts +4 -4
  61. package/internal/types.d.mts.map +1 -1
  62. package/internal/types.d.ts +4 -4
  63. package/internal/types.d.ts.map +1 -1
  64. package/internal/uploads.d.mts.map +1 -1
  65. package/internal/uploads.d.ts.map +1 -1
  66. package/internal/uploads.mjs.map +1 -1
  67. package/internal/utils/base64.mjs.map +1 -1
  68. package/internal/utils/log.d.mts.map +1 -1
  69. package/internal/utils/log.d.ts.map +1 -1
  70. package/internal/utils/log.js +3 -2
  71. package/internal/utils/log.js.map +1 -1
  72. package/internal/utils/log.mjs +3 -2
  73. package/internal/utils/log.mjs.map +1 -1
  74. package/internal/utils/path.mjs.map +1 -1
  75. package/internal/utils/query.mjs.map +1 -1
  76. package/internal/utils/values.mjs.map +1 -1
  77. package/internal/utils.d.mts.map +1 -1
  78. package/internal/utils.d.ts.map +1 -1
  79. package/internal/utils.mjs.map +1 -1
  80. package/package.json +1 -1
  81. package/resource.d.mts +1 -0
  82. package/resource.d.mts.map +1 -1
  83. package/resource.d.ts +1 -0
  84. package/resource.d.ts.map +1 -1
  85. package/resource.mjs +1 -0
  86. package/resource.mjs.map +1 -1
  87. package/resources/beta/beta.d.mts +2 -262
  88. package/resources/beta/beta.d.mts.map +1 -1
  89. package/resources/beta/beta.d.ts +2 -262
  90. package/resources/beta/beta.d.ts.map +1 -1
  91. package/resources/beta/beta.js +0 -41
  92. package/resources/beta/beta.js.map +1 -1
  93. package/resources/beta/beta.mjs +0 -41
  94. package/resources/beta/beta.mjs.map +1 -1
  95. package/resources/beta/findall.d.mts +76 -71
  96. package/resources/beta/findall.d.mts.map +1 -1
  97. package/resources/beta/findall.d.ts +76 -71
  98. package/resources/beta/findall.d.ts.map +1 -1
  99. package/resources/beta/findall.js +26 -23
  100. package/resources/beta/findall.js.map +1 -1
  101. package/resources/beta/findall.mjs +26 -23
  102. package/resources/beta/findall.mjs.map +1 -1
  103. package/resources/beta/index.d.mts +1 -3
  104. package/resources/beta/index.d.mts.map +1 -1
  105. package/resources/beta/index.d.ts +1 -3
  106. package/resources/beta/index.d.ts.map +1 -1
  107. package/resources/beta/index.js +1 -5
  108. package/resources/beta/index.js.map +1 -1
  109. package/resources/beta/index.mjs +0 -2
  110. package/resources/beta/index.mjs.map +1 -1
  111. package/resources/beta.d.mts.map +1 -1
  112. package/resources/beta.d.ts.map +1 -1
  113. package/resources/beta.mjs.map +1 -1
  114. package/resources/index.d.mts.map +1 -1
  115. package/resources/index.d.ts.map +1 -1
  116. package/resources/index.mjs.map +1 -1
  117. package/resources/monitor.d.mts.map +1 -1
  118. package/resources/monitor.d.ts.map +1 -1
  119. package/resources/monitor.mjs.map +1 -1
  120. package/resources/task-group.d.mts +2 -2
  121. package/resources/task-group.d.mts.map +1 -1
  122. package/resources/task-group.d.ts +2 -2
  123. package/resources/task-group.d.ts.map +1 -1
  124. package/resources/task-group.mjs.map +1 -1
  125. package/resources/task-run.d.mts +3 -3
  126. package/resources/task-run.d.mts.map +1 -1
  127. package/resources/task-run.d.ts +3 -3
  128. package/resources/task-run.d.ts.map +1 -1
  129. package/resources/task-run.mjs.map +1 -1
  130. package/resources/top-level.d.mts +1 -1
  131. package/resources/top-level.d.mts.map +1 -1
  132. package/resources/top-level.d.ts +1 -1
  133. package/resources/top-level.d.ts.map +1 -1
  134. package/resources.d.mts.map +1 -1
  135. package/resources.d.ts.map +1 -1
  136. package/resources.mjs.map +1 -1
  137. package/src/internal/utils/log.ts +2 -1
  138. package/src/resources/beta/api.md +4 -58
  139. package/src/resources/beta/beta.ts +8 -404
  140. package/src/resources/beta/findall.ts +102 -85
  141. package/src/resources/beta/index.ts +4 -29
  142. package/src/resources/task-group.ts +2 -2
  143. package/src/resources/task-run.ts +3 -3
  144. package/src/resources/top-level.ts +1 -1
  145. package/src/version.ts +1 -1
  146. package/streaming.d.mts +1 -0
  147. package/streaming.d.mts.map +1 -1
  148. package/streaming.d.ts +1 -0
  149. package/streaming.d.ts.map +1 -1
  150. package/streaming.mjs +1 -0
  151. package/streaming.mjs.map +1 -1
  152. package/uploads.d.mts +1 -0
  153. package/uploads.d.mts.map +1 -1
  154. package/uploads.d.ts +1 -0
  155. package/uploads.d.ts.map +1 -1
  156. package/uploads.mjs +1 -0
  157. package/uploads.mjs.map +1 -1
  158. package/version.d.mts +1 -1
  159. package/version.d.ts +1 -1
  160. package/version.js +1 -1
  161. package/version.mjs +1 -1
  162. package/resources/beta/task-group.d.mts +0 -122
  163. package/resources/beta/task-group.d.mts.map +0 -1
  164. package/resources/beta/task-group.d.ts +0 -122
  165. package/resources/beta/task-group.d.ts.map +0 -1
  166. package/resources/beta/task-group.js +0 -100
  167. package/resources/beta/task-group.js.map +0 -1
  168. package/resources/beta/task-group.mjs +0 -96
  169. package/resources/beta/task-group.mjs.map +0 -1
  170. package/resources/beta/task-run.d.mts +0 -191
  171. package/resources/beta/task-run.d.mts.map +0 -1
  172. package/resources/beta/task-run.d.ts +0 -191
  173. package/resources/beta/task-run.d.ts.map +0 -1
  174. package/resources/beta/task-run.js +0 -81
  175. package/resources/beta/task-run.js.map +0 -1
  176. package/resources/beta/task-run.mjs +0 -77
  177. package/resources/beta/task-run.mjs.map +0 -1
  178. package/src/resources/beta/task-group.ts +0 -223
  179. package/src/resources/beta/task-run.ts +0 -276
@@ -1,276 +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
- | TaskRunAPI.TaskRunProgressStatsEvent
108
- | TaskRunAPI.TaskRunProgressMessageEvent
109
- | TaskRunAPI.TaskRunEvent
110
- | TaskRunAPI.ErrorEvent;
111
-
112
- /**
113
- * @deprecated Use parallel.types.task_run.TaskRunInput instead
114
- */
115
- export type BetaRunInput = TaskRunAPI.RunInput;
116
-
117
- /**
118
- * @deprecated Use parallel.types.task_run.TaskRunResult instead
119
- */
120
- export type BetaTaskRunResult = TaskRunAPI.TaskRunResult;
121
-
122
- /**
123
- * Backwards-compatible namespace for `BetaTaskRunResult`.
124
- * @deprecated Use `TaskRunJsonOutput` and `TaskRunTextOutput` from `task-run` instead.
125
- */
126
- export namespace BetaTaskRunResult {
127
- /** @deprecated Use `TaskRunAPI.TaskRunTextOutput` instead */
128
- export type BetaTaskRunTextOutput = TaskRunAPI.TaskRunTextOutput;
129
- /** @deprecated Use `TaskRunAPI.TaskRunJsonOutput` instead */
130
- export type BetaTaskRunJsonOutput = TaskRunAPI.TaskRunJsonOutput;
131
- }
132
-
133
- /**
134
- * @deprecated Use parallel.types.task_run.Webhook instead
135
- */
136
- export type Webhook = TaskRunAPI.Webhook;
137
-
138
- /**
139
- * @deprecated Use parallel.types.task_run.McpServer instead
140
- */
141
- export type McpServer = TaskRunAPI.McpServer;
142
-
143
- /**
144
- * @deprecated Use parallel.types.task_run.McpToolCall instead
145
- */
146
- export type McpToolCall = TaskRunAPI.McpToolCall;
147
-
148
- /**
149
- * @deprecated Use parallel.types.task_run.TaskRunEvent instead
150
- */
151
- export type TaskRunEvent = TaskRunAPI.TaskRunEvent;
152
-
153
- /**
154
- * @deprecated Use parallel.types.task_run.ErrorEvent instead
155
- */
156
- export type ErrorEvent = TaskRunAPI.ErrorEvent;
157
-
158
- export interface TaskRunCreateParams {
159
- /**
160
- * Body param: Input to the task, either text or a JSON object.
161
- */
162
- input: string | { [key: string]: unknown };
163
-
164
- /**
165
- * Body param: Processor to use for the task.
166
- */
167
- processor: string;
168
-
169
- /**
170
- * Body param: Advanced search configuration for a task run.
171
- */
172
- advanced_settings?: TaskRunAPI.TaskAdvancedSettings | null;
173
-
174
- /**
175
- * Body param: Controls tracking of task run execution progress. When set to true,
176
- * progress events are recorded and can be accessed via the
177
- * [Task Run events](https://docs.parallel.ai/api-reference) endpoint. When false,
178
- * no progress events are tracked. Note that progress tracking cannot be enabled
179
- * after a run has been created. The flag is set to true by default for premium
180
- * processors (pro and above).
181
- */
182
- enable_events?: boolean | null;
183
-
184
- /**
185
- * Body param: Optional list of MCP servers to use for the run.
186
- */
187
- mcp_servers?: Array<TaskRunAPI.McpServer> | null;
188
-
189
- /**
190
- * Body param: User-provided metadata stored with the run. Keys and values must be
191
- * strings with a maximum length of 16 and 512 characters respectively.
192
- */
193
- metadata?: { [key: string]: string | number | boolean } | null;
194
-
195
- /**
196
- * Body param: Interaction ID to use as context for this request.
197
- */
198
- previous_interaction_id?: string | null;
199
-
200
- /**
201
- * Body param: Source policy for web search results.
202
- *
203
- * This policy governs which sources are allowed/disallowed in results.
204
- */
205
- source_policy?: Shared.SourcePolicy | null;
206
-
207
- /**
208
- * Body param: Specification for a task.
209
- *
210
- * Auto output schemas can be specified by setting `output_schema={"type":"auto"}`.
211
- * Not specifying a TaskSpec is the same as setting an auto output schema.
212
- *
213
- * For convenience bare strings are also accepted as input or output schemas.
214
- */
215
- task_spec?: TaskRunAPI.TaskSpec | null;
216
-
217
- /**
218
- * Body param: Webhooks for Task Runs.
219
- */
220
- webhook?: TaskRunAPI.Webhook | null;
221
-
222
- /**
223
- * Header param: Optional header to specify the beta version(s) to enable.
224
- */
225
- betas?: Array<ParallelBeta>;
226
- }
227
-
228
- export interface TaskRunResultParams {
229
- /**
230
- * Query param
231
- */
232
- timeout?: number;
233
-
234
- /**
235
- * Header param: Optional header to specify the beta version(s) to enable.
236
- */
237
- betas?: Array<ParallelBeta>;
238
- }
239
-
240
- export declare namespace TaskRun {
241
- export {
242
- type ParallelBeta as ParallelBeta,
243
- type TaskRunEventsResponse as TaskRunEventsResponse,
244
- type BetaRunInput as BetaRunInput,
245
- type BetaTaskRunResult as BetaTaskRunResult,
246
- type Webhook as Webhook,
247
- type McpServer as McpServer,
248
- type McpToolCall as McpToolCall,
249
- type TaskRunEvent as TaskRunEvent,
250
- type ErrorEvent as ErrorEvent,
251
- type TaskRunCreateParams as TaskRunCreateParams,
252
- type TaskRunResultParams as TaskRunResultParams,
253
- };
254
- }
255
-
256
- // Backwards-compat namespace members (deprecated). Previously these types
257
- // existed as nested interfaces under their parent's namespace; they've since
258
- // moved to top-level model types in the GA `task-run` module.
259
- type _TaskAdvancedSettings = TaskRunAPI.TaskAdvancedSettings;
260
- type _TaskRunProgressMessageEvent = TaskRunAPI.TaskRunProgressMessageEvent;
261
- type _TaskRunProgressStatsEvent = TaskRunAPI.TaskRunProgressStatsEvent;
262
- type _TaskRunSourceStats = TaskRunAPI.TaskRunSourceStats;
263
- export namespace TaskRunCreateParams {
264
- /** @deprecated Use `Parallel.TaskAdvancedSettings` instead. */
265
- export type AdvancedSettings = _TaskAdvancedSettings;
266
- }
267
- export namespace TaskRunEventsResponse {
268
- /** @deprecated Use `Parallel.TaskRunProgressMessageEvent` instead. */
269
- export type TaskRunProgressMessageEvent = _TaskRunProgressMessageEvent;
270
- /** @deprecated Use `Parallel.TaskRunProgressStatsEvent` instead. */
271
- export type TaskRunProgressStatsEvent = _TaskRunProgressStatsEvent;
272
- export namespace TaskRunProgressStatsEvent {
273
- /** @deprecated Use `Parallel.TaskRunSourceStats` instead. */
274
- export type SourceStats = _TaskRunSourceStats;
275
- }
276
- }