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.
- package/CHANGELOG.md +54 -0
- package/api-promise.d.mts +1 -0
- package/api-promise.d.mts.map +1 -1
- package/api-promise.d.ts +1 -0
- package/api-promise.d.ts.map +1 -1
- package/api-promise.mjs +1 -0
- package/api-promise.mjs.map +1 -1
- package/client.d.mts +29 -8
- package/client.d.mts.map +1 -1
- package/client.d.ts +29 -8
- package/client.d.ts.map +1 -1
- package/client.js +34 -4
- package/client.js.map +1 -1
- package/client.mjs +34 -4
- package/client.mjs.map +1 -1
- package/core/api-promise.d.mts.map +1 -1
- package/core/api-promise.d.ts.map +1 -1
- package/core/api-promise.mjs.map +1 -1
- package/core/error.mjs.map +1 -1
- package/core/resource.d.mts.map +1 -1
- package/core/resource.d.ts.map +1 -1
- package/core/streaming.d.mts.map +1 -1
- package/core/streaming.d.ts.map +1 -1
- package/core/streaming.mjs.map +1 -1
- package/core/uploads.d.mts.map +1 -1
- package/core/uploads.d.ts.map +1 -1
- package/core/uploads.mjs.map +1 -1
- package/error.d.mts +1 -0
- package/error.d.mts.map +1 -1
- package/error.d.ts +1 -0
- package/error.d.ts.map +1 -1
- package/error.mjs +1 -0
- package/error.mjs.map +1 -1
- package/index.d.mts.map +1 -1
- package/index.d.ts.map +1 -1
- package/index.mjs.map +1 -1
- package/internal/decoders/line.mjs.map +1 -1
- package/internal/detect-platform.mjs.map +1 -1
- package/internal/headers.mjs.map +1 -1
- package/internal/parse.d.mts.map +1 -1
- package/internal/parse.d.ts.map +1 -1
- package/internal/parse.mjs.map +1 -1
- package/internal/qs/formats.d.mts +7 -0
- package/internal/qs/formats.d.mts.map +1 -0
- package/internal/qs/formats.d.ts +7 -0
- package/internal/qs/formats.d.ts.map +1 -0
- package/internal/qs/formats.js +13 -0
- package/internal/qs/formats.js.map +1 -0
- package/internal/qs/formats.mjs +9 -0
- package/internal/qs/formats.mjs.map +1 -0
- package/internal/qs/index.d.mts +10 -0
- package/internal/qs/index.d.mts.map +1 -0
- package/internal/qs/index.d.ts +10 -0
- package/internal/qs/index.d.ts.map +1 -0
- package/internal/qs/index.js +14 -0
- package/internal/qs/index.js.map +1 -0
- package/internal/qs/index.mjs +10 -0
- package/internal/qs/index.mjs.map +1 -0
- package/internal/qs/stringify.d.mts +3 -0
- package/internal/qs/stringify.d.mts.map +1 -0
- package/internal/qs/stringify.d.ts +3 -0
- package/internal/qs/stringify.d.ts.map +1 -0
- package/internal/qs/stringify.js +277 -0
- package/internal/qs/stringify.js.map +1 -0
- package/internal/qs/stringify.mjs +274 -0
- package/internal/qs/stringify.mjs.map +1 -0
- package/internal/qs/types.d.mts +57 -0
- package/internal/qs/types.d.mts.map +1 -0
- package/internal/qs/types.d.ts +57 -0
- package/internal/qs/types.d.ts.map +1 -0
- package/internal/qs/types.js +3 -0
- package/internal/qs/types.js.map +1 -0
- package/internal/qs/types.mjs +2 -0
- package/internal/qs/types.mjs.map +1 -0
- package/internal/qs/utils.d.mts +15 -0
- package/internal/qs/utils.d.mts.map +1 -0
- package/internal/qs/utils.d.ts +15 -0
- package/internal/qs/utils.d.ts.map +1 -0
- package/internal/qs/utils.js +230 -0
- package/internal/qs/utils.js.map +1 -0
- package/internal/qs/utils.mjs +217 -0
- package/internal/qs/utils.mjs.map +1 -0
- package/internal/request-options.d.mts.map +1 -1
- package/internal/request-options.d.ts.map +1 -1
- package/internal/shims.d.mts +6 -0
- package/internal/shims.d.mts.map +1 -1
- package/internal/shims.d.ts +6 -0
- package/internal/shims.d.ts.map +1 -1
- package/internal/to-file.d.mts.map +1 -1
- package/internal/to-file.d.ts.map +1 -1
- package/internal/to-file.mjs.map +1 -1
- package/internal/types.d.mts +10 -10
- package/internal/types.d.mts.map +1 -1
- package/internal/types.d.ts +10 -10
- package/internal/types.d.ts.map +1 -1
- package/internal/uploads.d.mts.map +1 -1
- package/internal/uploads.d.ts.map +1 -1
- package/internal/uploads.mjs.map +1 -1
- package/internal/utils/base64.mjs.map +1 -1
- package/internal/utils/log.d.mts.map +1 -1
- package/internal/utils/log.d.ts.map +1 -1
- package/internal/utils/log.js +3 -2
- package/internal/utils/log.js.map +1 -1
- package/internal/utils/log.mjs +3 -2
- package/internal/utils/log.mjs.map +1 -1
- package/internal/utils/path.mjs.map +1 -1
- package/internal/utils/query.d.mts +0 -3
- package/internal/utils/query.d.mts.map +1 -1
- package/internal/utils/query.d.ts +0 -3
- package/internal/utils/query.d.ts.map +1 -1
- package/internal/utils/query.js +3 -16
- package/internal/utils/query.js.map +1 -1
- package/internal/utils/query.mjs +2 -16
- package/internal/utils/query.mjs.map +1 -1
- package/internal/utils/values.mjs.map +1 -1
- package/internal/utils.d.mts.map +1 -1
- package/internal/utils.d.ts.map +1 -1
- package/internal/utils.mjs.map +1 -1
- package/package.json +1 -1
- package/resource.d.mts +1 -0
- package/resource.d.mts.map +1 -1
- package/resource.d.ts +1 -0
- package/resource.d.ts.map +1 -1
- package/resource.mjs +1 -0
- package/resource.mjs.map +1 -1
- package/resources/beta/beta.d.mts +2 -270
- package/resources/beta/beta.d.mts.map +1 -1
- package/resources/beta/beta.d.ts +2 -270
- package/resources/beta/beta.d.ts.map +1 -1
- package/resources/beta/beta.js +0 -39
- package/resources/beta/beta.js.map +1 -1
- package/resources/beta/beta.mjs +0 -39
- package/resources/beta/beta.mjs.map +1 -1
- package/resources/beta/findall.d.mts +202 -247
- package/resources/beta/findall.d.mts.map +1 -1
- package/resources/beta/findall.d.ts +202 -247
- package/resources/beta/findall.d.ts.map +1 -1
- package/resources/beta/findall.js +28 -27
- package/resources/beta/findall.js.map +1 -1
- package/resources/beta/findall.mjs +28 -27
- package/resources/beta/findall.mjs.map +1 -1
- package/resources/beta/index.d.mts +1 -3
- package/resources/beta/index.d.mts.map +1 -1
- package/resources/beta/index.d.ts +1 -3
- package/resources/beta/index.d.ts.map +1 -1
- package/resources/beta/index.js +1 -5
- package/resources/beta/index.js.map +1 -1
- package/resources/beta/index.mjs +0 -2
- package/resources/beta/index.mjs.map +1 -1
- package/resources/beta.d.mts.map +1 -1
- package/resources/beta.d.ts.map +1 -1
- package/resources/beta.mjs.map +1 -1
- package/resources/index.d.mts +4 -2
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +4 -2
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +5 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +2 -0
- package/resources/index.mjs.map +1 -1
- package/resources/monitor.d.mts +625 -0
- package/resources/monitor.d.mts.map +1 -0
- package/resources/monitor.d.ts +625 -0
- package/resources/monitor.d.ts.map +1 -0
- package/resources/monitor.js +140 -0
- package/resources/monitor.js.map +1 -0
- package/resources/monitor.mjs +136 -0
- package/resources/monitor.mjs.map +1 -0
- package/resources/{beta/task-group.d.mts → task-group.d.mts} +38 -68
- package/resources/task-group.d.mts.map +1 -0
- package/resources/{beta/task-group.d.ts → task-group.d.ts} +38 -68
- package/resources/task-group.d.ts.map +1 -0
- package/resources/{beta/task-group.js → task-group.js} +24 -64
- package/resources/task-group.js.map +1 -0
- package/resources/{beta/task-group.mjs → task-group.mjs} +24 -64
- package/resources/task-group.mjs.map +1 -0
- package/resources/task-run.d.mts +100 -83
- package/resources/task-run.d.mts.map +1 -1
- package/resources/task-run.d.ts +100 -83
- package/resources/task-run.d.ts.map +1 -1
- package/resources/task-run.js +14 -1
- package/resources/task-run.js.map +1 -1
- package/resources/task-run.mjs +14 -1
- package/resources/task-run.mjs.map +1 -1
- package/resources/top-level.d.mts +20 -16
- package/resources/top-level.d.mts.map +1 -1
- package/resources/top-level.d.ts +20 -16
- package/resources/top-level.d.ts.map +1 -1
- package/resources.d.mts.map +1 -1
- package/resources.d.ts.map +1 -1
- package/resources.mjs.map +1 -1
- package/src/client.ts +120 -4
- package/src/internal/qs/LICENSE.md +13 -0
- package/src/internal/qs/README.md +3 -0
- package/src/internal/qs/formats.ts +10 -0
- package/src/internal/qs/index.ts +13 -0
- package/src/internal/qs/stringify.ts +385 -0
- package/src/internal/qs/types.ts +71 -0
- package/src/internal/qs/utils.ts +265 -0
- package/src/internal/types.ts +6 -8
- package/src/internal/utils/log.ts +2 -1
- package/src/internal/utils/query.ts +2 -18
- package/src/resources/beta/api.md +9 -59
- package/src/resources/beta/beta.ts +16 -406
- package/src/resources/beta/findall.ts +252 -284
- package/src/resources/beta/index.ts +8 -30
- package/src/resources/index.ts +42 -0
- package/src/resources/monitor.ts +752 -0
- package/src/resources/{beta/task-group.ts → task-group.ts} +58 -93
- package/src/resources/task-run.ts +125 -98
- package/src/resources/top-level.ts +24 -16
- package/src/version.ts +1 -1
- package/streaming.d.mts +1 -0
- package/streaming.d.mts.map +1 -1
- package/streaming.d.ts +1 -0
- package/streaming.d.ts.map +1 -1
- package/streaming.mjs +1 -0
- package/streaming.mjs.map +1 -1
- package/uploads.d.mts +1 -0
- package/uploads.d.mts.map +1 -1
- package/uploads.d.ts +1 -0
- package/uploads.d.ts.map +1 -1
- package/uploads.mjs +1 -0
- package/uploads.mjs.map +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
- package/resources/beta/task-group.d.mts.map +0 -1
- package/resources/beta/task-group.d.ts.map +0 -1
- package/resources/beta/task-group.js.map +0 -1
- package/resources/beta/task-group.mjs.map +0 -1
- package/resources/beta/task-run.d.mts +0 -239
- package/resources/beta/task-run.d.mts.map +0 -1
- package/resources/beta/task-run.d.ts +0 -239
- package/resources/beta/task-run.d.ts.map +0 -1
- package/resources/beta/task-run.js +0 -81
- package/resources/beta/task-run.js.map +0 -1
- package/resources/beta/task-run.mjs +0 -77
- package/resources/beta/task-run.mjs.map +0 -1
- package/src/resources/beta/task-run.ts +0 -336
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { APIResource } from '
|
|
4
|
-
import * as
|
|
5
|
-
import * as
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { path } from '../../internal/utils/path';
|
|
3
|
+
import { APIResource } from '../core/resource';
|
|
4
|
+
import * as TaskRunAPI from './task-run';
|
|
5
|
+
import * as FindAllAPI from './beta/findall';
|
|
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';
|
|
12
11
|
|
|
13
12
|
/**
|
|
14
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.
|
|
15
14
|
* - Output metadata: citations, excerpts, reasoning, and confidence per field
|
|
16
15
|
*
|
|
17
16
|
* Task Groups enable batch execution of many independent Task runs with group-level monitoring and failure handling.
|
|
18
|
-
*
|
|
17
|
+
* - Submit hundreds or thousands of Tasks as a single group
|
|
19
18
|
* - Observe group progress and receive results as they complete
|
|
20
19
|
* - Real-time updates via Server-Sent Events (SSE)
|
|
21
20
|
* - Add tasks to an existing group while it is running
|
|
@@ -24,52 +23,20 @@ import { path } from '../../internal/utils/path';
|
|
|
24
23
|
export class TaskGroup extends APIResource {
|
|
25
24
|
/**
|
|
26
25
|
* Initiates a TaskGroup to group and track multiple runs.
|
|
27
|
-
*
|
|
28
|
-
* @example
|
|
29
|
-
* ```ts
|
|
30
|
-
* const taskGroup = await client.beta.taskGroup.create();
|
|
31
|
-
* ```
|
|
32
26
|
*/
|
|
33
27
|
create(body: TaskGroupCreateParams, options?: RequestOptions): APIPromise<TaskGroup> {
|
|
34
|
-
return this._client.post('/
|
|
35
|
-
body,
|
|
36
|
-
...options,
|
|
37
|
-
headers: buildHeaders([{ 'parallel-beta': 'search-extract-2025-10-10' }, options?.headers]),
|
|
38
|
-
});
|
|
28
|
+
return this._client.post('/v1/tasks/groups', { body, ...options });
|
|
39
29
|
}
|
|
40
30
|
|
|
41
31
|
/**
|
|
42
32
|
* Retrieves aggregated status across runs in a TaskGroup.
|
|
43
|
-
*
|
|
44
|
-
* @example
|
|
45
|
-
* ```ts
|
|
46
|
-
* const taskGroup = await client.beta.taskGroup.retrieve(
|
|
47
|
-
* 'taskgroup_id',
|
|
48
|
-
* );
|
|
49
|
-
* ```
|
|
50
33
|
*/
|
|
51
34
|
retrieve(taskGroupID: string, options?: RequestOptions): APIPromise<TaskGroup> {
|
|
52
|
-
return this._client.get(path`/
|
|
53
|
-
...options,
|
|
54
|
-
headers: buildHeaders([{ 'parallel-beta': 'search-extract-2025-10-10' }, options?.headers]),
|
|
55
|
-
});
|
|
35
|
+
return this._client.get(path`/v1/tasks/groups/${taskGroupID}`, options);
|
|
56
36
|
}
|
|
57
37
|
|
|
58
38
|
/**
|
|
59
39
|
* Initiates multiple task runs within a TaskGroup.
|
|
60
|
-
*
|
|
61
|
-
* @example
|
|
62
|
-
* ```ts
|
|
63
|
-
* const taskGroupRunResponse =
|
|
64
|
-
* await client.beta.taskGroup.addRuns('taskgroup_id', {
|
|
65
|
-
* inputs: [
|
|
66
|
-
* {
|
|
67
|
-
* input: 'What was the GDP of France in 2023?',
|
|
68
|
-
* processor: 'base',
|
|
69
|
-
* },
|
|
70
|
-
* ],
|
|
71
|
-
* });
|
|
72
|
-
* ```
|
|
73
40
|
*/
|
|
74
41
|
addRuns(
|
|
75
42
|
taskGroupID: string,
|
|
@@ -77,12 +44,12 @@ export class TaskGroup extends APIResource {
|
|
|
77
44
|
options?: RequestOptions,
|
|
78
45
|
): APIPromise<TaskGroupRunResponse> {
|
|
79
46
|
const { refresh_status, betas, ...body } = params;
|
|
80
|
-
return this._client.post(path`/
|
|
47
|
+
return this._client.post(path`/v1/tasks/groups/${taskGroupID}/runs`, {
|
|
81
48
|
query: { refresh_status },
|
|
82
49
|
body,
|
|
83
50
|
...options,
|
|
84
51
|
headers: buildHeaders([
|
|
85
|
-
{
|
|
52
|
+
{ ...(betas?.toString() != null ? { 'parallel-beta': betas?.toString() } : undefined) },
|
|
86
53
|
options?.headers,
|
|
87
54
|
]),
|
|
88
55
|
});
|
|
@@ -93,26 +60,16 @@ export class TaskGroup extends APIResource {
|
|
|
93
60
|
*
|
|
94
61
|
* The connection will remain open for up to an hour as long as at least one run in
|
|
95
62
|
* the group is still active.
|
|
96
|
-
*
|
|
97
|
-
* @example
|
|
98
|
-
* ```ts
|
|
99
|
-
* const response = await client.beta.taskGroup.events(
|
|
100
|
-
* 'taskgroup_id',
|
|
101
|
-
* );
|
|
102
|
-
* ```
|
|
103
63
|
*/
|
|
104
64
|
events(
|
|
105
65
|
taskGroupID: string,
|
|
106
66
|
query: TaskGroupEventsParams | undefined = {},
|
|
107
67
|
options?: RequestOptions,
|
|
108
68
|
): APIPromise<Stream<TaskGroupEventsResponse>> {
|
|
109
|
-
return this._client.get(path`/
|
|
69
|
+
return this._client.get(path`/v1/tasks/groups/${taskGroupID}/events`, {
|
|
110
70
|
query,
|
|
111
71
|
...options,
|
|
112
|
-
headers: buildHeaders([
|
|
113
|
-
{ 'parallel-beta': 'search-extract-2025-10-10', Accept: 'text/event-stream' },
|
|
114
|
-
options?.headers,
|
|
115
|
-
]),
|
|
72
|
+
headers: buildHeaders([{ Accept: 'text/event-stream' }, options?.headers]),
|
|
116
73
|
stream: true,
|
|
117
74
|
}) as APIPromise<Stream<TaskGroupEventsResponse>>;
|
|
118
75
|
}
|
|
@@ -128,29 +85,36 @@ export class TaskGroup extends APIResource {
|
|
|
128
85
|
* specify the `last_event_id` parameter with the `event_id` of the last event in
|
|
129
86
|
* the stream. The stream will resume from the next event after the
|
|
130
87
|
* `last_event_id`.
|
|
131
|
-
*
|
|
132
|
-
* @example
|
|
133
|
-
* ```ts
|
|
134
|
-
* const response = await client.beta.taskGroup.getRuns(
|
|
135
|
-
* 'taskgroup_id',
|
|
136
|
-
* );
|
|
137
|
-
* ```
|
|
138
88
|
*/
|
|
139
89
|
getRuns(
|
|
140
90
|
taskGroupID: string,
|
|
141
91
|
query: TaskGroupGetRunsParams | undefined = {},
|
|
142
92
|
options?: RequestOptions,
|
|
143
93
|
): APIPromise<Stream<TaskGroupGetRunsResponse>> {
|
|
144
|
-
return this._client.get(path`/
|
|
94
|
+
return this._client.get(path`/v1/tasks/groups/${taskGroupID}/runs`, {
|
|
145
95
|
query,
|
|
146
96
|
...options,
|
|
147
|
-
headers: buildHeaders([
|
|
148
|
-
{ 'parallel-beta': 'search-extract-2025-10-10', Accept: 'text/event-stream' },
|
|
149
|
-
options?.headers,
|
|
150
|
-
]),
|
|
97
|
+
headers: buildHeaders([{ Accept: 'text/event-stream' }, options?.headers]),
|
|
151
98
|
stream: true,
|
|
152
99
|
}) as APIPromise<Stream<TaskGroupGetRunsResponse>>;
|
|
153
100
|
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Retrieves run status by run_id.
|
|
104
|
+
*
|
|
105
|
+
* This endpoint is equivalent to fetching run status directly using the
|
|
106
|
+
* `retrieve()` method or the `tasks/runs` GET endpoint.
|
|
107
|
+
*
|
|
108
|
+
* The run result is available from the `/result` endpoint.
|
|
109
|
+
*/
|
|
110
|
+
retrieveRun(
|
|
111
|
+
runID: string,
|
|
112
|
+
params: TaskGroupRetrieveRunParams,
|
|
113
|
+
options?: RequestOptions,
|
|
114
|
+
): APIPromise<TaskRunAPI.TaskRun> {
|
|
115
|
+
const { taskgroup_id } = params;
|
|
116
|
+
return this._client.get(path`/v1/tasks/groups/${taskgroup_id}/runs/${runID}`, options);
|
|
117
|
+
}
|
|
154
118
|
}
|
|
155
119
|
|
|
156
120
|
/**
|
|
@@ -241,33 +205,28 @@ export interface TaskGroupStatus {
|
|
|
241
205
|
/**
|
|
242
206
|
* Event indicating an update to group status.
|
|
243
207
|
*/
|
|
244
|
-
export
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
208
|
+
export interface TaskGroupStatusEvent {
|
|
209
|
+
/**
|
|
210
|
+
* Cursor to resume the event stream.
|
|
211
|
+
*/
|
|
212
|
+
event_id: string;
|
|
248
213
|
|
|
249
|
-
export namespace TaskGroupEventsResponse {
|
|
250
214
|
/**
|
|
251
|
-
*
|
|
215
|
+
* Task group status object.
|
|
252
216
|
*/
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
/**
|
|
260
|
-
* Task group status object.
|
|
261
|
-
*/
|
|
262
|
-
status: TaskGroupAPI.TaskGroupStatus;
|
|
263
|
-
|
|
264
|
-
/**
|
|
265
|
-
* Event type; always 'task_group_status'.
|
|
266
|
-
*/
|
|
267
|
-
type: 'task_group_status';
|
|
268
|
-
}
|
|
217
|
+
status: TaskGroupStatus;
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* Event type; always 'task_group_status'.
|
|
221
|
+
*/
|
|
222
|
+
type: 'task_group_status';
|
|
269
223
|
}
|
|
270
224
|
|
|
225
|
+
/**
|
|
226
|
+
* Event indicating an update to group status.
|
|
227
|
+
*/
|
|
228
|
+
export type TaskGroupEventsResponse = TaskGroupStatusEvent | TaskRunAPI.TaskRunEvent | TaskRunAPI.ErrorEvent;
|
|
229
|
+
|
|
271
230
|
/**
|
|
272
231
|
* Event when a task run transitions to a non-active status.
|
|
273
232
|
*
|
|
@@ -308,7 +267,7 @@ export interface TaskGroupAddRunsParams {
|
|
|
308
267
|
/**
|
|
309
268
|
* Header param: Optional header to specify the beta version(s) to enable.
|
|
310
269
|
*/
|
|
311
|
-
betas?: Array<
|
|
270
|
+
betas?: Array<FindAllAPI.ParallelBeta>;
|
|
312
271
|
}
|
|
313
272
|
|
|
314
273
|
export interface TaskGroupEventsParams {
|
|
@@ -335,16 +294,22 @@ export interface TaskGroupGetRunsParams {
|
|
|
335
294
|
| null;
|
|
336
295
|
}
|
|
337
296
|
|
|
297
|
+
export interface TaskGroupRetrieveRunParams {
|
|
298
|
+
taskgroup_id: string;
|
|
299
|
+
}
|
|
300
|
+
|
|
338
301
|
export declare namespace TaskGroup {
|
|
339
302
|
export {
|
|
340
303
|
type TaskGroup as TaskGroup,
|
|
341
304
|
type TaskGroupRunResponse as TaskGroupRunResponse,
|
|
342
305
|
type TaskGroupStatus as TaskGroupStatus,
|
|
306
|
+
type TaskGroupStatusEvent as TaskGroupStatusEvent,
|
|
343
307
|
type TaskGroupEventsResponse as TaskGroupEventsResponse,
|
|
344
308
|
type TaskGroupGetRunsResponse as TaskGroupGetRunsResponse,
|
|
345
309
|
type TaskGroupCreateParams as TaskGroupCreateParams,
|
|
346
310
|
type TaskGroupAddRunsParams as TaskGroupAddRunsParams,
|
|
347
311
|
type TaskGroupEventsParams as TaskGroupEventsParams,
|
|
348
312
|
type TaskGroupGetRunsParams as TaskGroupGetRunsParams,
|
|
313
|
+
type TaskGroupRetrieveRunParams as TaskGroupRetrieveRunParams,
|
|
349
314
|
};
|
|
350
315
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { APIResource } from '../core/resource';
|
|
4
4
|
import * as Shared from './shared';
|
|
5
|
-
import * as
|
|
5
|
+
import * as FindAllAPI from './beta/findall';
|
|
6
6
|
import { APIPromise } from '../core/api-promise';
|
|
7
7
|
import { Stream } from '../core/streaming';
|
|
8
8
|
import { buildHeaders } from '../internal/headers';
|
|
@@ -14,7 +14,7 @@ import { path } from '../internal/utils/path';
|
|
|
14
14
|
* - Output metadata: citations, excerpts, reasoning, and confidence per field
|
|
15
15
|
*
|
|
16
16
|
* Task Groups enable batch execution of many independent Task runs with group-level monitoring and failure handling.
|
|
17
|
-
*
|
|
17
|
+
* - Submit hundreds or thousands of Tasks as a single group
|
|
18
18
|
* - Observe group progress and receive results as they complete
|
|
19
19
|
* - Real-time updates via Server-Sent Events (SSE)
|
|
20
20
|
* - Add tasks to an existing group while it is running
|
|
@@ -107,6 +107,20 @@ export class TaskRun extends APIResource {
|
|
|
107
107
|
]),
|
|
108
108
|
});
|
|
109
109
|
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Retrieves the input of a run by run_id.
|
|
113
|
+
*
|
|
114
|
+
* @example
|
|
115
|
+
* ```ts
|
|
116
|
+
* const runInput = await client.taskRun.retrieveInput(
|
|
117
|
+
* 'run_id',
|
|
118
|
+
* );
|
|
119
|
+
* ```
|
|
120
|
+
*/
|
|
121
|
+
retrieveInput(runID: string, options?: RequestOptions): APIPromise<RunInput> {
|
|
122
|
+
return this._client.get(path`/v1/tasks/runs/${runID}/input`, options);
|
|
123
|
+
}
|
|
110
124
|
}
|
|
111
125
|
|
|
112
126
|
/**
|
|
@@ -278,7 +292,7 @@ export interface RunInput {
|
|
|
278
292
|
/**
|
|
279
293
|
* Advanced search configuration for a task run.
|
|
280
294
|
*/
|
|
281
|
-
advanced_settings?:
|
|
295
|
+
advanced_settings?: TaskAdvancedSettings | null;
|
|
282
296
|
|
|
283
297
|
/**
|
|
284
298
|
* Controls tracking of task run execution progress. When set to true, progress
|
|
@@ -329,16 +343,14 @@ export interface RunInput {
|
|
|
329
343
|
webhook?: Webhook | null;
|
|
330
344
|
}
|
|
331
345
|
|
|
332
|
-
|
|
346
|
+
/**
|
|
347
|
+
* Advanced search configuration for a task run.
|
|
348
|
+
*/
|
|
349
|
+
export interface TaskAdvancedSettings {
|
|
333
350
|
/**
|
|
334
|
-
*
|
|
351
|
+
* ISO 3166-1 alpha-2 country code for geo-targeted search results.
|
|
335
352
|
*/
|
|
336
|
-
|
|
337
|
-
/**
|
|
338
|
-
* ISO 3166-1 alpha-2 country code for geo-targeted search results.
|
|
339
|
-
*/
|
|
340
|
-
location?: string | null;
|
|
341
|
-
}
|
|
353
|
+
location?: string | null;
|
|
342
354
|
}
|
|
343
355
|
|
|
344
356
|
/**
|
|
@@ -476,6 +488,52 @@ export interface TaskRunJsonOutput {
|
|
|
476
488
|
output_schema?: { [key: string]: unknown } | null;
|
|
477
489
|
}
|
|
478
490
|
|
|
491
|
+
/**
|
|
492
|
+
* A message for a task run progress update.
|
|
493
|
+
*/
|
|
494
|
+
export interface TaskRunProgressMessageEvent {
|
|
495
|
+
/**
|
|
496
|
+
* Progress update message.
|
|
497
|
+
*/
|
|
498
|
+
message: string;
|
|
499
|
+
|
|
500
|
+
/**
|
|
501
|
+
* Timestamp of the message.
|
|
502
|
+
*/
|
|
503
|
+
timestamp: string | null;
|
|
504
|
+
|
|
505
|
+
/**
|
|
506
|
+
* Event type; always starts with 'task_run.progress_msg'.
|
|
507
|
+
*/
|
|
508
|
+
type:
|
|
509
|
+
| 'task_run.progress_msg.plan'
|
|
510
|
+
| 'task_run.progress_msg.search'
|
|
511
|
+
| 'task_run.progress_msg.result'
|
|
512
|
+
| 'task_run.progress_msg.tool_call'
|
|
513
|
+
| 'task_run.progress_msg.exec_status';
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
/**
|
|
517
|
+
* A progress update for a task run.
|
|
518
|
+
*/
|
|
519
|
+
export interface TaskRunProgressStatsEvent {
|
|
520
|
+
/**
|
|
521
|
+
* Completion percentage of the task run. Ranges from 0 to 100 where 0 indicates no
|
|
522
|
+
* progress and 100 indicates completion.
|
|
523
|
+
*/
|
|
524
|
+
progress_meter: number;
|
|
525
|
+
|
|
526
|
+
/**
|
|
527
|
+
* Source stats describing progress so far.
|
|
528
|
+
*/
|
|
529
|
+
source_stats: TaskRunSourceStats;
|
|
530
|
+
|
|
531
|
+
/**
|
|
532
|
+
* Event type; always 'task_run.progress_stats'.
|
|
533
|
+
*/
|
|
534
|
+
type: 'task_run.progress_stats';
|
|
535
|
+
}
|
|
536
|
+
|
|
479
537
|
/**
|
|
480
538
|
* Result of a task run.
|
|
481
539
|
*/
|
|
@@ -491,6 +549,26 @@ export interface TaskRunResult {
|
|
|
491
549
|
run: TaskRun;
|
|
492
550
|
}
|
|
493
551
|
|
|
552
|
+
/**
|
|
553
|
+
* Source stats for a task run.
|
|
554
|
+
*/
|
|
555
|
+
export interface TaskRunSourceStats {
|
|
556
|
+
/**
|
|
557
|
+
* Number of sources considered in processing the task.
|
|
558
|
+
*/
|
|
559
|
+
num_sources_considered: number | null;
|
|
560
|
+
|
|
561
|
+
/**
|
|
562
|
+
* Number of sources read in processing the task.
|
|
563
|
+
*/
|
|
564
|
+
num_sources_read: number | null;
|
|
565
|
+
|
|
566
|
+
/**
|
|
567
|
+
* A sample of URLs of sources read in processing the task.
|
|
568
|
+
*/
|
|
569
|
+
sources_read_sample: Array<string> | null;
|
|
570
|
+
}
|
|
571
|
+
|
|
494
572
|
/**
|
|
495
573
|
* Output from a task that returns text.
|
|
496
574
|
*/
|
|
@@ -581,81 +659,11 @@ export interface Webhook {
|
|
|
581
659
|
* A progress update for a task run.
|
|
582
660
|
*/
|
|
583
661
|
export type TaskRunEventsResponse =
|
|
584
|
-
|
|
|
585
|
-
|
|
|
662
|
+
| TaskRunProgressStatsEvent
|
|
663
|
+
| TaskRunProgressMessageEvent
|
|
586
664
|
| TaskRunEvent
|
|
587
665
|
| ErrorEvent;
|
|
588
666
|
|
|
589
|
-
export namespace TaskRunEventsResponse {
|
|
590
|
-
/**
|
|
591
|
-
* A progress update for a task run.
|
|
592
|
-
*/
|
|
593
|
-
export interface TaskRunProgressStatsEvent {
|
|
594
|
-
/**
|
|
595
|
-
* Completion percentage of the task run. Ranges from 0 to 100 where 0 indicates no
|
|
596
|
-
* progress and 100 indicates completion.
|
|
597
|
-
*/
|
|
598
|
-
progress_meter: number;
|
|
599
|
-
|
|
600
|
-
/**
|
|
601
|
-
* Source stats describing progress so far.
|
|
602
|
-
*/
|
|
603
|
-
source_stats: TaskRunProgressStatsEvent.SourceStats;
|
|
604
|
-
|
|
605
|
-
/**
|
|
606
|
-
* Event type; always 'task_run.progress_stats'.
|
|
607
|
-
*/
|
|
608
|
-
type: 'task_run.progress_stats';
|
|
609
|
-
}
|
|
610
|
-
|
|
611
|
-
export namespace TaskRunProgressStatsEvent {
|
|
612
|
-
/**
|
|
613
|
-
* Source stats describing progress so far.
|
|
614
|
-
*/
|
|
615
|
-
export interface SourceStats {
|
|
616
|
-
/**
|
|
617
|
-
* Number of sources considered in processing the task.
|
|
618
|
-
*/
|
|
619
|
-
num_sources_considered: number | null;
|
|
620
|
-
|
|
621
|
-
/**
|
|
622
|
-
* Number of sources read in processing the task.
|
|
623
|
-
*/
|
|
624
|
-
num_sources_read: number | null;
|
|
625
|
-
|
|
626
|
-
/**
|
|
627
|
-
* A sample of URLs of sources read in processing the task.
|
|
628
|
-
*/
|
|
629
|
-
sources_read_sample: Array<string> | null;
|
|
630
|
-
}
|
|
631
|
-
}
|
|
632
|
-
|
|
633
|
-
/**
|
|
634
|
-
* A message for a task run progress update.
|
|
635
|
-
*/
|
|
636
|
-
export interface TaskRunProgressMessageEvent {
|
|
637
|
-
/**
|
|
638
|
-
* Progress update message.
|
|
639
|
-
*/
|
|
640
|
-
message: string;
|
|
641
|
-
|
|
642
|
-
/**
|
|
643
|
-
* Timestamp of the message.
|
|
644
|
-
*/
|
|
645
|
-
timestamp: string | null;
|
|
646
|
-
|
|
647
|
-
/**
|
|
648
|
-
* Event type; always starts with 'task_run.progress_msg'.
|
|
649
|
-
*/
|
|
650
|
-
type:
|
|
651
|
-
| 'task_run.progress_msg.plan'
|
|
652
|
-
| 'task_run.progress_msg.search'
|
|
653
|
-
| 'task_run.progress_msg.result'
|
|
654
|
-
| 'task_run.progress_msg.tool_call'
|
|
655
|
-
| 'task_run.progress_msg.exec_status';
|
|
656
|
-
}
|
|
657
|
-
}
|
|
658
|
-
|
|
659
667
|
export interface TaskRunCreateParams {
|
|
660
668
|
/**
|
|
661
669
|
* Body param: Input to the task, either text or a JSON object.
|
|
@@ -670,7 +678,7 @@ export interface TaskRunCreateParams {
|
|
|
670
678
|
/**
|
|
671
679
|
* Body param: Advanced search configuration for a task run.
|
|
672
680
|
*/
|
|
673
|
-
advanced_settings?:
|
|
681
|
+
advanced_settings?: TaskAdvancedSettings | null;
|
|
674
682
|
|
|
675
683
|
/**
|
|
676
684
|
* Body param: Controls tracking of task run execution progress. When set to true,
|
|
@@ -723,19 +731,7 @@ export interface TaskRunCreateParams {
|
|
|
723
731
|
/**
|
|
724
732
|
* Header param: Optional header to specify the beta version(s) to enable.
|
|
725
733
|
*/
|
|
726
|
-
betas?: Array<
|
|
727
|
-
}
|
|
728
|
-
|
|
729
|
-
export namespace TaskRunCreateParams {
|
|
730
|
-
/**
|
|
731
|
-
* Advanced search configuration for a task run.
|
|
732
|
-
*/
|
|
733
|
-
export interface AdvancedSettings {
|
|
734
|
-
/**
|
|
735
|
-
* ISO 3166-1 alpha-2 country code for geo-targeted search results.
|
|
736
|
-
*/
|
|
737
|
-
location?: string | null;
|
|
738
|
-
}
|
|
734
|
+
betas?: Array<FindAllAPI.ParallelBeta>;
|
|
739
735
|
}
|
|
740
736
|
|
|
741
737
|
export interface TaskRunResultParams {
|
|
@@ -747,7 +743,7 @@ export interface TaskRunResultParams {
|
|
|
747
743
|
/**
|
|
748
744
|
* Header param: Optional header to specify the beta version(s) to enable.
|
|
749
745
|
*/
|
|
750
|
-
betas?: Array<
|
|
746
|
+
betas?: Array<FindAllAPI.ParallelBeta>;
|
|
751
747
|
}
|
|
752
748
|
|
|
753
749
|
export declare namespace TaskRun {
|
|
@@ -760,10 +756,14 @@ export declare namespace TaskRun {
|
|
|
760
756
|
type McpServer as McpServer,
|
|
761
757
|
type McpToolCall as McpToolCall,
|
|
762
758
|
type RunInput as RunInput,
|
|
759
|
+
type TaskAdvancedSettings as TaskAdvancedSettings,
|
|
763
760
|
type TaskRun as TaskRun,
|
|
764
761
|
type TaskRunEvent as TaskRunEvent,
|
|
765
762
|
type TaskRunJsonOutput as TaskRunJsonOutput,
|
|
763
|
+
type TaskRunProgressMessageEvent as TaskRunProgressMessageEvent,
|
|
764
|
+
type TaskRunProgressStatsEvent as TaskRunProgressStatsEvent,
|
|
766
765
|
type TaskRunResult as TaskRunResult,
|
|
766
|
+
type TaskRunSourceStats as TaskRunSourceStats,
|
|
767
767
|
type TaskRunTextOutput as TaskRunTextOutput,
|
|
768
768
|
type TaskSpec as TaskSpec,
|
|
769
769
|
type TextSchema as TextSchema,
|
|
@@ -773,3 +773,30 @@ export declare namespace TaskRun {
|
|
|
773
773
|
type TaskRunResultParams as TaskRunResultParams,
|
|
774
774
|
};
|
|
775
775
|
}
|
|
776
|
+
|
|
777
|
+
// Backwards-compat namespace members (deprecated). Previously these types
|
|
778
|
+
// existed as nested interfaces under the parent type's namespace; they've
|
|
779
|
+
// since moved to top-level model types. Declaration merging here preserves
|
|
780
|
+
// the old `Parent.Member` import paths.
|
|
781
|
+
type _TaskAdvancedSettings = TaskAdvancedSettings;
|
|
782
|
+
type _TaskRunProgressMessageEvent = TaskRunProgressMessageEvent;
|
|
783
|
+
type _TaskRunProgressStatsEvent = TaskRunProgressStatsEvent;
|
|
784
|
+
type _TaskRunSourceStats = TaskRunSourceStats;
|
|
785
|
+
export namespace RunInput {
|
|
786
|
+
/** @deprecated Use the top-level `TaskAdvancedSettings` instead. */
|
|
787
|
+
export type AdvancedSettings = _TaskAdvancedSettings;
|
|
788
|
+
}
|
|
789
|
+
export namespace TaskRunCreateParams {
|
|
790
|
+
/** @deprecated Use the top-level `TaskAdvancedSettings` instead. */
|
|
791
|
+
export type AdvancedSettings = _TaskAdvancedSettings;
|
|
792
|
+
}
|
|
793
|
+
export namespace TaskRunEventsResponse {
|
|
794
|
+
/** @deprecated Use the top-level `TaskRunProgressMessageEvent` instead. */
|
|
795
|
+
export type TaskRunProgressMessageEvent = _TaskRunProgressMessageEvent;
|
|
796
|
+
/** @deprecated Use the top-level `TaskRunProgressStatsEvent` instead. */
|
|
797
|
+
export type TaskRunProgressStatsEvent = _TaskRunProgressStatsEvent;
|
|
798
|
+
export namespace TaskRunProgressStatsEvent {
|
|
799
|
+
/** @deprecated Use the top-level `TaskRunSourceStats` instead. */
|
|
800
|
+
export type SourceStats = _TaskRunSourceStats;
|
|
801
|
+
}
|
|
802
|
+
}
|
|
@@ -23,21 +23,7 @@ export interface AdvancedExtractSettings {
|
|
|
23
23
|
* Controls full content extraction. Set to true to enable with defaults, false to
|
|
24
24
|
* disable, or provide FullContentSettings for fine-grained control.
|
|
25
25
|
*/
|
|
26
|
-
full_content?:
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export namespace AdvancedExtractSettings {
|
|
30
|
-
/**
|
|
31
|
-
* Optional settings for returning full content.
|
|
32
|
-
*/
|
|
33
|
-
export interface FullContentSettings {
|
|
34
|
-
/**
|
|
35
|
-
* Optional limit on the number of characters to include in the full content for
|
|
36
|
-
* each url. Full content always starts at the beginning of the page and is
|
|
37
|
-
* truncated at the limit if necessary.
|
|
38
|
-
*/
|
|
39
|
-
max_chars_per_result?: number | null;
|
|
40
|
-
}
|
|
26
|
+
full_content?: FullContentSettings | boolean;
|
|
41
27
|
}
|
|
42
28
|
|
|
43
29
|
/**
|
|
@@ -82,7 +68,7 @@ export interface ExcerptSettings {
|
|
|
82
68
|
/**
|
|
83
69
|
* Optional upper bound on the total number of characters to include per url.
|
|
84
70
|
* Excerpts may contain fewer characters than this limit to maximize relevance and
|
|
85
|
-
* token efficiency.
|
|
71
|
+
* token efficiency.
|
|
86
72
|
*/
|
|
87
73
|
max_chars_per_result?: number | null;
|
|
88
74
|
}
|
|
@@ -198,6 +184,18 @@ export interface FetchPolicy {
|
|
|
198
184
|
timeout_seconds?: number | null;
|
|
199
185
|
}
|
|
200
186
|
|
|
187
|
+
/**
|
|
188
|
+
* Optional settings for returning full content.
|
|
189
|
+
*/
|
|
190
|
+
export interface FullContentSettings {
|
|
191
|
+
/**
|
|
192
|
+
* Optional limit on the number of characters to include in the full content for
|
|
193
|
+
* each url. Full content always starts at the beginning of the page and is
|
|
194
|
+
* truncated at the limit if necessary.
|
|
195
|
+
*/
|
|
196
|
+
max_chars_per_result?: number | null;
|
|
197
|
+
}
|
|
198
|
+
|
|
201
199
|
/**
|
|
202
200
|
* Search response.
|
|
203
201
|
*/
|
|
@@ -376,6 +374,7 @@ export declare namespace TopLevel {
|
|
|
376
374
|
type ExtractResponse as ExtractResponse,
|
|
377
375
|
type ExtractResult as ExtractResult,
|
|
378
376
|
type FetchPolicy as FetchPolicy,
|
|
377
|
+
type FullContentSettings as FullContentSettings,
|
|
379
378
|
type SearchResult as SearchResult,
|
|
380
379
|
type UsageItem as UsageItem,
|
|
381
380
|
type WebSearchResult as WebSearchResult,
|
|
@@ -383,3 +382,12 @@ export declare namespace TopLevel {
|
|
|
383
382
|
type SearchParams as SearchParams,
|
|
384
383
|
};
|
|
385
384
|
}
|
|
385
|
+
|
|
386
|
+
// Backwards-compat namespace member (deprecated). `AdvancedExtractSettings.FullContentSettings`
|
|
387
|
+
// was previously a nested interface; the shape now lives as the top-level
|
|
388
|
+
// `FullContentSettings` model. Declaration merging here preserves the old path.
|
|
389
|
+
export namespace AdvancedExtractSettings {
|
|
390
|
+
/** @deprecated Use the top-level `FullContentSettings` instead. */
|
|
391
|
+
export type FullContentSettings = TopLevelFullContentSettings;
|
|
392
|
+
}
|
|
393
|
+
type TopLevelFullContentSettings = FullContentSettings;
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '1.0.0'; // x-release-please-version
|
package/streaming.d.mts
CHANGED
package/streaming.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"streaming.d.mts","sourceRoot":"","sources":["src/streaming.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"streaming.d.mts","sourceRoot":"","sources":["src/streaming.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,qCAAiC"}
|
package/streaming.d.ts
CHANGED
package/streaming.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"streaming.d.ts","sourceRoot":"","sources":["src/streaming.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"streaming.d.ts","sourceRoot":"","sources":["src/streaming.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,oCAAiC"}
|
package/streaming.mjs
CHANGED
package/streaming.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"streaming.mjs","sourceRoot":"","sources":["src/streaming.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"streaming.mjs","sourceRoot":"","sources":["src/streaming.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,qCAAiC"}
|
package/uploads.d.mts
CHANGED
package/uploads.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uploads.d.mts","sourceRoot":"","sources":["src/uploads.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"uploads.d.mts","sourceRoot":"","sources":["src/uploads.ts"],"names":[],"mappings":"AAAA,qDAAqD;AACrD,mCAA+B"}
|