parallel-web 0.3.1 → 0.4.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.
- package/CHANGELOG.md +76 -0
- package/README.md +2 -2
- package/client.d.mts +46 -3
- package/client.d.mts.map +1 -1
- package/client.d.ts +46 -3
- package/client.d.ts.map +1 -1
- package/client.js +66 -19
- package/client.js.map +1 -1
- package/client.mjs +66 -19
- package/client.mjs.map +1 -1
- package/core/streaming.js.map +1 -1
- package/core/streaming.mjs.map +1 -1
- package/internal/parse.d.mts.map +1 -1
- package/internal/parse.d.ts.map +1 -1
- package/internal/parse.js +5 -0
- package/internal/parse.js.map +1 -1
- package/internal/parse.mjs +5 -0
- package/internal/parse.mjs.map +1 -1
- package/internal/utils/env.js +2 -2
- package/internal/utils/env.js.map +1 -1
- package/internal/utils/env.mjs +2 -2
- package/internal/utils/env.mjs.map +1 -1
- package/internal/utils/query.d.mts +5 -0
- package/internal/utils/query.d.mts.map +1 -0
- package/internal/utils/query.d.ts +5 -0
- package/internal/utils/query.d.ts.map +1 -0
- package/internal/utils/query.js +23 -0
- package/internal/utils/query.js.map +1 -0
- package/internal/utils/query.mjs +20 -0
- package/internal/utils/query.mjs.map +1 -0
- package/internal/utils.d.mts +1 -0
- package/internal/utils.d.ts +1 -0
- package/internal/utils.js +1 -0
- package/internal/utils.js.map +1 -1
- package/internal/utils.mjs +1 -0
- package/package.json +12 -1
- package/resources/beta/beta.d.mts +52 -72
- package/resources/beta/beta.d.mts.map +1 -1
- package/resources/beta/beta.d.ts +52 -72
- package/resources/beta/beta.d.ts.map +1 -1
- package/resources/beta/beta.js +10 -4
- package/resources/beta/beta.js.map +1 -1
- package/resources/beta/beta.mjs +10 -4
- package/resources/beta/beta.mjs.map +1 -1
- package/resources/beta/findall.d.mts +171 -9
- package/resources/beta/findall.d.mts.map +1 -1
- package/resources/beta/findall.d.ts +171 -9
- package/resources/beta/findall.d.ts.map +1 -1
- package/resources/beta/findall.js +111 -0
- package/resources/beta/findall.js.map +1 -1
- package/resources/beta/findall.mjs +111 -0
- package/resources/beta/findall.mjs.map +1 -1
- package/resources/beta/index.d.mts +2 -2
- package/resources/beta/index.d.mts.map +1 -1
- package/resources/beta/index.d.ts +2 -2
- package/resources/beta/index.d.ts.map +1 -1
- package/resources/beta/index.js.map +1 -1
- package/resources/beta/index.mjs.map +1 -1
- package/resources/beta/task-group.d.mts +60 -4
- package/resources/beta/task-group.d.mts.map +1 -1
- package/resources/beta/task-group.d.ts +60 -4
- package/resources/beta/task-group.d.ts.map +1 -1
- package/resources/beta/task-group.js +52 -1
- package/resources/beta/task-group.js.map +1 -1
- package/resources/beta/task-group.mjs +52 -1
- package/resources/beta/task-group.mjs.map +1 -1
- package/resources/beta/task-run.d.mts +85 -266
- package/resources/beta/task-run.d.mts.map +1 -1
- package/resources/beta/task-run.d.ts +85 -266
- package/resources/beta/task-run.d.ts.map +1 -1
- package/resources/beta/task-run.js +21 -2
- package/resources/beta/task-run.js.map +1 -1
- package/resources/beta/task-run.mjs +21 -2
- package/resources/beta/task-run.mjs.map +1 -1
- package/resources/index.d.mts +2 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +2 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/shared.d.mts +4 -2
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +4 -2
- package/resources/shared.d.ts.map +1 -1
- package/resources/task-run.d.mts +324 -29
- package/resources/task-run.d.mts.map +1 -1
- package/resources/task-run.d.ts +324 -29
- package/resources/task-run.d.ts.map +1 -1
- package/resources/task-run.js +71 -4
- package/resources/task-run.js.map +1 -1
- package/resources/task-run.mjs +71 -4
- package/resources/task-run.mjs.map +1 -1
- package/resources/top-level.d.mts +317 -0
- package/resources/top-level.d.mts.map +1 -0
- package/resources/top-level.d.ts +317 -0
- package/resources/top-level.d.ts.map +1 -0
- package/resources/top-level.js +4 -0
- package/resources/top-level.js.map +1 -0
- package/resources/top-level.mjs +3 -0
- package/resources/top-level.mjs.map +1 -0
- package/src/client.ts +118 -24
- package/src/core/streaming.ts +2 -2
- package/src/internal/parse.ts +6 -0
- package/src/internal/utils/env.ts +2 -2
- package/src/internal/utils/query.ts +23 -0
- package/src/internal/utils.ts +1 -0
- package/src/resources/beta/api.md +87 -0
- package/src/resources/beta/beta.ts +67 -84
- package/src/resources/beta/findall.ts +191 -7
- package/src/resources/beta/index.ts +7 -4
- package/src/resources/beta/task-group.ts +64 -6
- package/src/resources/beta/task-run.ts +103 -300
- package/src/resources/index.ts +20 -0
- package/src/resources/shared.ts +4 -2
- package/src/resources/task-run.ts +410 -31
- package/src/resources/top-level.ts +385 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
3
|
import { APIResource } from '../../core/resource';
|
|
4
|
-
import * as BetaTaskRunAPI from './task-run';
|
|
5
4
|
import * as Shared from '../shared';
|
|
6
5
|
import * as TaskRunAPI from '../task-run';
|
|
7
6
|
import { APIPromise } from '../../core/api-promise';
|
|
@@ -10,6 +9,19 @@ import { buildHeaders } from '../../internal/headers';
|
|
|
10
9
|
import { RequestOptions } from '../../internal/request-options';
|
|
11
10
|
import { path } from '../../internal/utils/path';
|
|
12
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
|
+
*/
|
|
13
25
|
export class TaskRun extends APIResource {
|
|
14
26
|
/**
|
|
15
27
|
* Initiates a task run.
|
|
@@ -17,10 +29,12 @@ export class TaskRun extends APIResource {
|
|
|
17
29
|
* Returns immediately with a run object in status 'queued'.
|
|
18
30
|
*
|
|
19
31
|
* Beta features can be enabled by setting the 'parallel-beta' header.
|
|
32
|
+
*
|
|
33
|
+
* @deprecated Use GA Task Run instead
|
|
20
34
|
*/
|
|
21
35
|
create(params: TaskRunCreateParams, options?: RequestOptions): APIPromise<TaskRunAPI.TaskRun> {
|
|
22
36
|
const { betas, ...body } = params;
|
|
23
|
-
return this._client.post('/v1/tasks/runs
|
|
37
|
+
return this._client.post('/v1/tasks/runs', {
|
|
24
38
|
body,
|
|
25
39
|
...options,
|
|
26
40
|
headers: buildHeaders([
|
|
@@ -38,6 +52,8 @@ export class TaskRun extends APIResource {
|
|
|
38
52
|
*
|
|
39
53
|
* For task runs that did not have enable_events set to true during creation, the
|
|
40
54
|
* frequency of events will be reduced.
|
|
55
|
+
*
|
|
56
|
+
* @deprecated Use GA Task Run instead
|
|
41
57
|
*/
|
|
42
58
|
events(runID: string, options?: RequestOptions): APIPromise<Stream<TaskRunEventsResponse>> {
|
|
43
59
|
return this._client.get(path`/v1beta/tasks/runs/${runID}/events`, {
|
|
@@ -52,14 +68,16 @@ export class TaskRun extends APIResource {
|
|
|
52
68
|
|
|
53
69
|
/**
|
|
54
70
|
* Retrieves a run result by run_id, blocking until the run is completed.
|
|
71
|
+
*
|
|
72
|
+
* @deprecated Use GA Task Run instead
|
|
55
73
|
*/
|
|
56
74
|
result(
|
|
57
75
|
runID: string,
|
|
58
76
|
params: TaskRunResultParams | null | undefined = {},
|
|
59
77
|
options?: RequestOptions,
|
|
60
|
-
): APIPromise<
|
|
78
|
+
): APIPromise<TaskRunAPI.TaskRunResult> {
|
|
61
79
|
const { betas, ...query } = params ?? {};
|
|
62
|
-
return this._client.get(path`/v1/tasks/runs/${runID}/result
|
|
80
|
+
return this._client.get(path`/v1/tasks/runs/${runID}/result`, {
|
|
63
81
|
query,
|
|
64
82
|
...options,
|
|
65
83
|
headers: buildHeaders([
|
|
@@ -70,238 +88,6 @@ export class TaskRun extends APIResource {
|
|
|
70
88
|
}
|
|
71
89
|
}
|
|
72
90
|
|
|
73
|
-
/**
|
|
74
|
-
* Task run input with additional beta fields.
|
|
75
|
-
*/
|
|
76
|
-
export interface BetaRunInput {
|
|
77
|
-
/**
|
|
78
|
-
* Input to the task, either text or a JSON object.
|
|
79
|
-
*/
|
|
80
|
-
input: string | { [key: string]: unknown };
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* Processor to use for the task.
|
|
84
|
-
*/
|
|
85
|
-
processor: string;
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* Controls tracking of task run execution progress. When set to true, progress
|
|
89
|
-
* events are recorded and can be accessed via the
|
|
90
|
-
* [Task Run events](https://platform.parallel.ai/api-reference) endpoint. When
|
|
91
|
-
* false, no progress events are tracked. Note that progress tracking cannot be
|
|
92
|
-
* enabled after a run has been created. The flag is set to true by default for
|
|
93
|
-
* premium processors (pro and above). To enable this feature in your requests,
|
|
94
|
-
* specify `events-sse-2025-07-24` as one of the values in `parallel-beta` header
|
|
95
|
-
* (for API calls) or `betas` param (for the SDKs).
|
|
96
|
-
*/
|
|
97
|
-
enable_events?: boolean | null;
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
* Optional list of MCP servers to use for the run. To enable this feature in your
|
|
101
|
-
* requests, specify `mcp-server-2025-07-17` as one of the values in
|
|
102
|
-
* `parallel-beta` header (for API calls) or `betas` param (for the SDKs).
|
|
103
|
-
*/
|
|
104
|
-
mcp_servers?: Array<McpServer> | null;
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* User-provided metadata stored with the run. Keys and values must be strings with
|
|
108
|
-
* a maximum length of 16 and 512 characters respectively.
|
|
109
|
-
*/
|
|
110
|
-
metadata?: { [key: string]: string | number | boolean } | null;
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* Source policy for web search results.
|
|
114
|
-
*
|
|
115
|
-
* This policy governs which sources are allowed/disallowed in results.
|
|
116
|
-
*/
|
|
117
|
-
source_policy?: Shared.SourcePolicy | null;
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* Specification for a task.
|
|
121
|
-
*
|
|
122
|
-
* Auto output schemas can be specified by setting `output_schema={"type":"auto"}`.
|
|
123
|
-
* Not specifying a TaskSpec is the same as setting an auto output schema.
|
|
124
|
-
*
|
|
125
|
-
* For convenience bare strings are also accepted as input or output schemas.
|
|
126
|
-
*/
|
|
127
|
-
task_spec?: TaskRunAPI.TaskSpec | null;
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
* Webhooks for Task Runs.
|
|
131
|
-
*/
|
|
132
|
-
webhook?: Webhook | null;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
/**
|
|
136
|
-
* Result of a beta task run. Available only if beta headers are specified.
|
|
137
|
-
*/
|
|
138
|
-
export interface BetaTaskRunResult {
|
|
139
|
-
/**
|
|
140
|
-
* Output from the task conforming to the output schema.
|
|
141
|
-
*/
|
|
142
|
-
output: BetaTaskRunResult.BetaTaskRunTextOutput | BetaTaskRunResult.BetaTaskRunJsonOutput;
|
|
143
|
-
|
|
144
|
-
/**
|
|
145
|
-
* Beta task run object with status 'completed'.
|
|
146
|
-
*/
|
|
147
|
-
run: TaskRunAPI.TaskRun;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
export namespace BetaTaskRunResult {
|
|
151
|
-
/**
|
|
152
|
-
* Output from a task that returns text.
|
|
153
|
-
*/
|
|
154
|
-
export interface BetaTaskRunTextOutput {
|
|
155
|
-
/**
|
|
156
|
-
* Basis for the output. To include per-list-element basis entries, send the
|
|
157
|
-
* `parallel-beta` header with the value `field-basis-2025-11-25` when creating the
|
|
158
|
-
* run.
|
|
159
|
-
*/
|
|
160
|
-
basis: Array<TaskRunAPI.FieldBasis>;
|
|
161
|
-
|
|
162
|
-
/**
|
|
163
|
-
* Text output from the task.
|
|
164
|
-
*/
|
|
165
|
-
content: string;
|
|
166
|
-
|
|
167
|
-
/**
|
|
168
|
-
* The type of output being returned, as determined by the output schema of the
|
|
169
|
-
* task spec.
|
|
170
|
-
*/
|
|
171
|
-
type: 'text';
|
|
172
|
-
|
|
173
|
-
/**
|
|
174
|
-
* Always None.
|
|
175
|
-
*/
|
|
176
|
-
beta_fields?: { [key: string]: unknown } | null;
|
|
177
|
-
|
|
178
|
-
/**
|
|
179
|
-
* MCP tool calls made by the task.
|
|
180
|
-
*/
|
|
181
|
-
mcp_tool_calls?: Array<BetaTaskRunAPI.McpToolCall> | null;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
/**
|
|
185
|
-
* Output from a task that returns JSON.
|
|
186
|
-
*/
|
|
187
|
-
export interface BetaTaskRunJsonOutput {
|
|
188
|
-
/**
|
|
189
|
-
* Basis for the output. To include per-list-element basis entries, send the
|
|
190
|
-
* `parallel-beta` header with the value `field-basis-2025-11-25` when creating the
|
|
191
|
-
* run.
|
|
192
|
-
*/
|
|
193
|
-
basis: Array<TaskRunAPI.FieldBasis>;
|
|
194
|
-
|
|
195
|
-
/**
|
|
196
|
-
* Output from the task as a native JSON object, as determined by the output schema
|
|
197
|
-
* of the task spec.
|
|
198
|
-
*/
|
|
199
|
-
content: { [key: string]: unknown };
|
|
200
|
-
|
|
201
|
-
/**
|
|
202
|
-
* The type of output being returned, as determined by the output schema of the
|
|
203
|
-
* task spec.
|
|
204
|
-
*/
|
|
205
|
-
type: 'json';
|
|
206
|
-
|
|
207
|
-
/**
|
|
208
|
-
* Always None.
|
|
209
|
-
*/
|
|
210
|
-
beta_fields?: { [key: string]: unknown } | null;
|
|
211
|
-
|
|
212
|
-
/**
|
|
213
|
-
* MCP tool calls made by the task.
|
|
214
|
-
*/
|
|
215
|
-
mcp_tool_calls?: Array<BetaTaskRunAPI.McpToolCall> | null;
|
|
216
|
-
|
|
217
|
-
/**
|
|
218
|
-
* Output schema for the Task Run. Populated only if the task was executed with an
|
|
219
|
-
* auto schema.
|
|
220
|
-
*/
|
|
221
|
-
output_schema?: { [key: string]: unknown } | null;
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
/**
|
|
226
|
-
* Event indicating an error.
|
|
227
|
-
*/
|
|
228
|
-
export interface ErrorEvent {
|
|
229
|
-
/**
|
|
230
|
-
* Error.
|
|
231
|
-
*/
|
|
232
|
-
error: Shared.ErrorObject;
|
|
233
|
-
|
|
234
|
-
/**
|
|
235
|
-
* Event type; always 'error'.
|
|
236
|
-
*/
|
|
237
|
-
type: 'error';
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
/**
|
|
241
|
-
* MCP server configuration.
|
|
242
|
-
*/
|
|
243
|
-
export interface McpServer {
|
|
244
|
-
/**
|
|
245
|
-
* Name of the MCP server.
|
|
246
|
-
*/
|
|
247
|
-
name: string;
|
|
248
|
-
|
|
249
|
-
/**
|
|
250
|
-
* URL of the MCP server.
|
|
251
|
-
*/
|
|
252
|
-
url: string;
|
|
253
|
-
|
|
254
|
-
/**
|
|
255
|
-
* List of allowed tools for the MCP server.
|
|
256
|
-
*/
|
|
257
|
-
allowed_tools?: Array<string> | null;
|
|
258
|
-
|
|
259
|
-
/**
|
|
260
|
-
* Headers for the MCP server.
|
|
261
|
-
*/
|
|
262
|
-
headers?: { [key: string]: string } | null;
|
|
263
|
-
|
|
264
|
-
/**
|
|
265
|
-
* Type of MCP server being configured. Always `url`.
|
|
266
|
-
*/
|
|
267
|
-
type?: 'url';
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
/**
|
|
271
|
-
* Result of an MCP tool call.
|
|
272
|
-
*/
|
|
273
|
-
export interface McpToolCall {
|
|
274
|
-
/**
|
|
275
|
-
* Arguments used to call the MCP tool.
|
|
276
|
-
*/
|
|
277
|
-
arguments: string;
|
|
278
|
-
|
|
279
|
-
/**
|
|
280
|
-
* Name of the MCP server.
|
|
281
|
-
*/
|
|
282
|
-
server_name: string;
|
|
283
|
-
|
|
284
|
-
/**
|
|
285
|
-
* Identifier for the tool call.
|
|
286
|
-
*/
|
|
287
|
-
tool_call_id: string;
|
|
288
|
-
|
|
289
|
-
/**
|
|
290
|
-
* Name of the tool being called.
|
|
291
|
-
*/
|
|
292
|
-
tool_name: string;
|
|
293
|
-
|
|
294
|
-
/**
|
|
295
|
-
* Output received from the tool call, if successful.
|
|
296
|
-
*/
|
|
297
|
-
content?: string | null;
|
|
298
|
-
|
|
299
|
-
/**
|
|
300
|
-
* Error message if the tool call failed.
|
|
301
|
-
*/
|
|
302
|
-
error?: string | null;
|
|
303
|
-
}
|
|
304
|
-
|
|
305
91
|
/**
|
|
306
92
|
* Model for the parallel-beta header.
|
|
307
93
|
*/
|
|
@@ -314,61 +100,14 @@ export type ParallelBeta =
|
|
|
314
100
|
| 'field-basis-2025-11-25'
|
|
315
101
|
| (string & {});
|
|
316
102
|
|
|
317
|
-
/**
|
|
318
|
-
* Event when a task run transitions to a non-active status.
|
|
319
|
-
*
|
|
320
|
-
* May indicate completion, cancellation, or failure.
|
|
321
|
-
*/
|
|
322
|
-
export interface TaskRunEvent {
|
|
323
|
-
/**
|
|
324
|
-
* Cursor to resume the event stream. Always empty for non Task Group runs.
|
|
325
|
-
*/
|
|
326
|
-
event_id: string | null;
|
|
327
|
-
|
|
328
|
-
/**
|
|
329
|
-
* Task run object.
|
|
330
|
-
*/
|
|
331
|
-
run: TaskRunAPI.TaskRun;
|
|
332
|
-
|
|
333
|
-
/**
|
|
334
|
-
* Event type; always 'task_run.state'.
|
|
335
|
-
*/
|
|
336
|
-
type: 'task_run.state';
|
|
337
|
-
|
|
338
|
-
/**
|
|
339
|
-
* Task run input with additional beta fields.
|
|
340
|
-
*/
|
|
341
|
-
input?: BetaRunInput | null;
|
|
342
|
-
|
|
343
|
-
/**
|
|
344
|
-
* Output from the run; included only if requested and if status == `completed`.
|
|
345
|
-
*/
|
|
346
|
-
output?: TaskRunAPI.TaskRunTextOutput | TaskRunAPI.TaskRunJsonOutput | null;
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
/**
|
|
350
|
-
* Webhooks for Task Runs.
|
|
351
|
-
*/
|
|
352
|
-
export interface Webhook {
|
|
353
|
-
/**
|
|
354
|
-
* URL for the webhook.
|
|
355
|
-
*/
|
|
356
|
-
url: string;
|
|
357
|
-
|
|
358
|
-
/**
|
|
359
|
-
* Event types to send the webhook notifications for.
|
|
360
|
-
*/
|
|
361
|
-
event_types?: Array<'task_run.status'>;
|
|
362
|
-
}
|
|
363
|
-
|
|
364
103
|
/**
|
|
365
104
|
* A progress update for a task run.
|
|
366
105
|
*/
|
|
367
106
|
export type TaskRunEventsResponse =
|
|
368
107
|
| TaskRunEventsResponse.TaskRunProgressStatsEvent
|
|
369
108
|
| TaskRunEventsResponse.TaskRunProgressMessageEvent
|
|
370
|
-
| TaskRunEvent
|
|
371
|
-
| ErrorEvent;
|
|
109
|
+
| TaskRunAPI.TaskRunEvent
|
|
110
|
+
| TaskRunAPI.ErrorEvent;
|
|
372
111
|
|
|
373
112
|
export namespace TaskRunEventsResponse {
|
|
374
113
|
/**
|
|
@@ -440,6 +179,52 @@ export namespace TaskRunEventsResponse {
|
|
|
440
179
|
}
|
|
441
180
|
}
|
|
442
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
|
+
|
|
443
228
|
export interface TaskRunCreateParams {
|
|
444
229
|
/**
|
|
445
230
|
* Body param: Input to the task, either text or a JSON object.
|
|
@@ -451,24 +236,25 @@ export interface TaskRunCreateParams {
|
|
|
451
236
|
*/
|
|
452
237
|
processor: string;
|
|
453
238
|
|
|
239
|
+
/**
|
|
240
|
+
* Body param: Advanced search configuration for a task run.
|
|
241
|
+
*/
|
|
242
|
+
advanced_settings?: TaskRunCreateParams.AdvancedSettings | null;
|
|
243
|
+
|
|
454
244
|
/**
|
|
455
245
|
* Body param: Controls tracking of task run execution progress. When set to true,
|
|
456
246
|
* progress events are recorded and can be accessed via the
|
|
457
|
-
* [Task Run events](https://
|
|
458
|
-
*
|
|
459
|
-
*
|
|
460
|
-
*
|
|
461
|
-
* specify `events-sse-2025-07-24` as one of the values in `parallel-beta` header
|
|
462
|
-
* (for API calls) or `betas` param (for the SDKs).
|
|
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).
|
|
463
251
|
*/
|
|
464
252
|
enable_events?: boolean | null;
|
|
465
253
|
|
|
466
254
|
/**
|
|
467
|
-
* Body param: Optional list of MCP servers to use for the run.
|
|
468
|
-
* feature in your requests, specify `mcp-server-2025-07-17` as one of the values
|
|
469
|
-
* in `parallel-beta` header (for API calls) or `betas` param (for the SDKs).
|
|
255
|
+
* Body param: Optional list of MCP servers to use for the run.
|
|
470
256
|
*/
|
|
471
|
-
mcp_servers?: Array<McpServer> | null;
|
|
257
|
+
mcp_servers?: Array<TaskRunAPI.McpServer> | null;
|
|
472
258
|
|
|
473
259
|
/**
|
|
474
260
|
* Body param: User-provided metadata stored with the run. Keys and values must be
|
|
@@ -476,6 +262,11 @@ export interface TaskRunCreateParams {
|
|
|
476
262
|
*/
|
|
477
263
|
metadata?: { [key: string]: string | number | boolean } | null;
|
|
478
264
|
|
|
265
|
+
/**
|
|
266
|
+
* Body param: Interaction ID to use as context for this request.
|
|
267
|
+
*/
|
|
268
|
+
previous_interaction_id?: string | null;
|
|
269
|
+
|
|
479
270
|
/**
|
|
480
271
|
* Body param: Source policy for web search results.
|
|
481
272
|
*
|
|
@@ -496,7 +287,7 @@ export interface TaskRunCreateParams {
|
|
|
496
287
|
/**
|
|
497
288
|
* Body param: Webhooks for Task Runs.
|
|
498
289
|
*/
|
|
499
|
-
webhook?: Webhook | null;
|
|
290
|
+
webhook?: TaskRunAPI.Webhook | null;
|
|
500
291
|
|
|
501
292
|
/**
|
|
502
293
|
* Header param: Optional header to specify the beta version(s) to enable.
|
|
@@ -504,6 +295,18 @@ export interface TaskRunCreateParams {
|
|
|
504
295
|
betas?: Array<ParallelBeta>;
|
|
505
296
|
}
|
|
506
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
|
+
|
|
507
310
|
export interface TaskRunResultParams {
|
|
508
311
|
/**
|
|
509
312
|
* Query param
|
|
@@ -518,15 +321,15 @@ export interface TaskRunResultParams {
|
|
|
518
321
|
|
|
519
322
|
export declare namespace TaskRun {
|
|
520
323
|
export {
|
|
324
|
+
type ParallelBeta as ParallelBeta,
|
|
325
|
+
type TaskRunEventsResponse as TaskRunEventsResponse,
|
|
521
326
|
type BetaRunInput as BetaRunInput,
|
|
522
327
|
type BetaTaskRunResult as BetaTaskRunResult,
|
|
523
|
-
type
|
|
328
|
+
type Webhook as Webhook,
|
|
524
329
|
type McpServer as McpServer,
|
|
525
330
|
type McpToolCall as McpToolCall,
|
|
526
|
-
type ParallelBeta as ParallelBeta,
|
|
527
331
|
type TaskRunEvent as TaskRunEvent,
|
|
528
|
-
type
|
|
529
|
-
type TaskRunEventsResponse as TaskRunEventsResponse,
|
|
332
|
+
type ErrorEvent as ErrorEvent,
|
|
530
333
|
type TaskRunCreateParams as TaskRunCreateParams,
|
|
531
334
|
type TaskRunResultParams as TaskRunResultParams,
|
|
532
335
|
};
|
package/src/resources/index.ts
CHANGED
|
@@ -6,14 +6,34 @@ export {
|
|
|
6
6
|
TaskRun,
|
|
7
7
|
type AutoSchema,
|
|
8
8
|
type Citation,
|
|
9
|
+
type ErrorEvent,
|
|
9
10
|
type FieldBasis,
|
|
10
11
|
type JsonSchema,
|
|
12
|
+
type McpServer,
|
|
13
|
+
type McpToolCall,
|
|
11
14
|
type RunInput,
|
|
15
|
+
type TaskRunEvent,
|
|
12
16
|
type TaskRunJsonOutput,
|
|
13
17
|
type TaskRunResult,
|
|
14
18
|
type TaskRunTextOutput,
|
|
15
19
|
type TaskSpec,
|
|
16
20
|
type TextSchema,
|
|
21
|
+
type Webhook,
|
|
22
|
+
type TaskRunEventsResponse,
|
|
17
23
|
type TaskRunCreateParams,
|
|
18
24
|
type TaskRunResultParams,
|
|
19
25
|
} from './task-run';
|
|
26
|
+
export {
|
|
27
|
+
type AdvancedExtractSettings,
|
|
28
|
+
type AdvancedSearchSettings,
|
|
29
|
+
type ExcerptSettings,
|
|
30
|
+
type ExtractError,
|
|
31
|
+
type ExtractResponse,
|
|
32
|
+
type ExtractResult,
|
|
33
|
+
type FetchPolicy,
|
|
34
|
+
type SearchResult,
|
|
35
|
+
type UsageItem,
|
|
36
|
+
type WebSearchResult,
|
|
37
|
+
type ExtractParams,
|
|
38
|
+
type SearchParams,
|
|
39
|
+
} from './top-level';
|
package/src/resources/shared.ts
CHANGED
|
@@ -52,7 +52,8 @@ export interface SourcePolicy {
|
|
|
52
52
|
* List of domains to exclude from results. If specified, sources from these
|
|
53
53
|
* domains will be excluded. Accepts plain domains (e.g., example.com,
|
|
54
54
|
* subdomain.example.gov) or bare domain extension starting with a period (e.g.,
|
|
55
|
-
* .gov, .edu, .co.uk).
|
|
55
|
+
* .gov, .edu, .co.uk). The combined number of domains in include_domains and
|
|
56
|
+
* exclude_domains cannot exceed 200.
|
|
56
57
|
*/
|
|
57
58
|
exclude_domains?: Array<string>;
|
|
58
59
|
|
|
@@ -60,7 +61,8 @@ export interface SourcePolicy {
|
|
|
60
61
|
* List of domains to restrict the results to. If specified, only sources from
|
|
61
62
|
* these domains will be included. Accepts plain domains (e.g., example.com,
|
|
62
63
|
* subdomain.example.gov) or bare domain extension starting with a period (e.g.,
|
|
63
|
-
* .gov, .edu, .co.uk).
|
|
64
|
+
* .gov, .edu, .co.uk). The combined number of domains in include_domains and
|
|
65
|
+
* exclude_domains cannot exceed 200.
|
|
64
66
|
*/
|
|
65
67
|
include_domains?: Array<string>;
|
|
66
68
|
}
|