parallel-web 0.4.1 → 0.5.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 (160) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/client.d.mts +29 -8
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +29 -8
  5. package/client.d.ts.map +1 -1
  6. package/client.js +34 -4
  7. package/client.js.map +1 -1
  8. package/client.mjs +34 -4
  9. package/client.mjs.map +1 -1
  10. package/internal/qs/formats.d.mts +7 -0
  11. package/internal/qs/formats.d.mts.map +1 -0
  12. package/internal/qs/formats.d.ts +7 -0
  13. package/internal/qs/formats.d.ts.map +1 -0
  14. package/internal/qs/formats.js +13 -0
  15. package/internal/qs/formats.js.map +1 -0
  16. package/internal/qs/formats.mjs +9 -0
  17. package/internal/qs/formats.mjs.map +1 -0
  18. package/internal/qs/index.d.mts +10 -0
  19. package/internal/qs/index.d.mts.map +1 -0
  20. package/internal/qs/index.d.ts +10 -0
  21. package/internal/qs/index.d.ts.map +1 -0
  22. package/internal/qs/index.js +14 -0
  23. package/internal/qs/index.js.map +1 -0
  24. package/internal/qs/index.mjs +10 -0
  25. package/internal/qs/index.mjs.map +1 -0
  26. package/internal/qs/stringify.d.mts +3 -0
  27. package/internal/qs/stringify.d.mts.map +1 -0
  28. package/internal/qs/stringify.d.ts +3 -0
  29. package/internal/qs/stringify.d.ts.map +1 -0
  30. package/internal/qs/stringify.js +277 -0
  31. package/internal/qs/stringify.js.map +1 -0
  32. package/internal/qs/stringify.mjs +274 -0
  33. package/internal/qs/stringify.mjs.map +1 -0
  34. package/internal/qs/types.d.mts +57 -0
  35. package/internal/qs/types.d.mts.map +1 -0
  36. package/internal/qs/types.d.ts +57 -0
  37. package/internal/qs/types.d.ts.map +1 -0
  38. package/internal/qs/types.js +3 -0
  39. package/internal/qs/types.js.map +1 -0
  40. package/internal/qs/types.mjs +2 -0
  41. package/internal/qs/types.mjs.map +1 -0
  42. package/internal/qs/utils.d.mts +15 -0
  43. package/internal/qs/utils.d.mts.map +1 -0
  44. package/internal/qs/utils.d.ts +15 -0
  45. package/internal/qs/utils.d.ts.map +1 -0
  46. package/internal/qs/utils.js +230 -0
  47. package/internal/qs/utils.js.map +1 -0
  48. package/internal/qs/utils.mjs +217 -0
  49. package/internal/qs/utils.mjs.map +1 -0
  50. package/internal/types.d.mts +6 -6
  51. package/internal/types.d.mts.map +1 -1
  52. package/internal/types.d.ts +6 -6
  53. package/internal/types.d.ts.map +1 -1
  54. package/internal/utils/query.d.mts +0 -3
  55. package/internal/utils/query.d.mts.map +1 -1
  56. package/internal/utils/query.d.ts +0 -3
  57. package/internal/utils/query.d.ts.map +1 -1
  58. package/internal/utils/query.js +3 -16
  59. package/internal/utils/query.js.map +1 -1
  60. package/internal/utils/query.mjs +2 -16
  61. package/internal/utils/query.mjs.map +1 -1
  62. package/package.json +1 -1
  63. package/resources/beta/beta.d.mts +11 -19
  64. package/resources/beta/beta.d.mts.map +1 -1
  65. package/resources/beta/beta.d.ts +11 -19
  66. package/resources/beta/beta.d.ts.map +1 -1
  67. package/resources/beta/beta.js +2 -0
  68. package/resources/beta/beta.js.map +1 -1
  69. package/resources/beta/beta.mjs +2 -0
  70. package/resources/beta/beta.mjs.map +1 -1
  71. package/resources/beta/findall.d.mts +127 -177
  72. package/resources/beta/findall.d.mts.map +1 -1
  73. package/resources/beta/findall.d.ts +127 -177
  74. package/resources/beta/findall.d.ts.map +1 -1
  75. package/resources/beta/findall.js +2 -4
  76. package/resources/beta/findall.js.map +1 -1
  77. package/resources/beta/findall.mjs +2 -4
  78. package/resources/beta/findall.mjs.map +1 -1
  79. package/resources/beta/index.d.mts +2 -2
  80. package/resources/beta/index.d.mts.map +1 -1
  81. package/resources/beta/index.d.ts +2 -2
  82. package/resources/beta/index.d.ts.map +1 -1
  83. package/resources/beta/index.js.map +1 -1
  84. package/resources/beta/index.mjs.map +1 -1
  85. package/resources/beta/task-group.d.mts +22 -143
  86. package/resources/beta/task-group.d.mts.map +1 -1
  87. package/resources/beta/task-group.d.ts +22 -143
  88. package/resources/beta/task-group.d.ts.map +1 -1
  89. package/resources/beta/task-group.js +7 -42
  90. package/resources/beta/task-group.js.map +1 -1
  91. package/resources/beta/task-group.mjs +7 -42
  92. package/resources/beta/task-group.mjs.map +1 -1
  93. package/resources/beta/task-run.d.mts +22 -70
  94. package/resources/beta/task-run.d.mts.map +1 -1
  95. package/resources/beta/task-run.d.ts +22 -70
  96. package/resources/beta/task-run.d.ts.map +1 -1
  97. package/resources/beta/task-run.js +1 -1
  98. package/resources/beta/task-run.mjs +1 -1
  99. package/resources/index.d.mts +4 -2
  100. package/resources/index.d.mts.map +1 -1
  101. package/resources/index.d.ts +4 -2
  102. package/resources/index.d.ts.map +1 -1
  103. package/resources/index.js +5 -1
  104. package/resources/index.js.map +1 -1
  105. package/resources/index.mjs +2 -0
  106. package/resources/index.mjs.map +1 -1
  107. package/resources/monitor.d.mts +625 -0
  108. package/resources/monitor.d.mts.map +1 -0
  109. package/resources/monitor.d.ts +625 -0
  110. package/resources/monitor.d.ts.map +1 -0
  111. package/resources/monitor.js +140 -0
  112. package/resources/monitor.js.map +1 -0
  113. package/resources/monitor.mjs +136 -0
  114. package/resources/monitor.mjs.map +1 -0
  115. package/resources/task-group.d.mts +213 -0
  116. package/resources/task-group.d.mts.map +1 -0
  117. package/resources/task-group.d.ts +213 -0
  118. package/resources/task-group.d.ts.map +1 -0
  119. package/resources/task-group.js +95 -0
  120. package/resources/task-group.js.map +1 -0
  121. package/resources/task-group.mjs +91 -0
  122. package/resources/task-group.mjs.map +1 -0
  123. package/resources/task-run.d.mts +97 -80
  124. package/resources/task-run.d.mts.map +1 -1
  125. package/resources/task-run.d.ts +97 -80
  126. package/resources/task-run.d.ts.map +1 -1
  127. package/resources/task-run.js +14 -1
  128. package/resources/task-run.js.map +1 -1
  129. package/resources/task-run.mjs +14 -1
  130. package/resources/task-run.mjs.map +1 -1
  131. package/resources/top-level.d.mts +19 -15
  132. package/resources/top-level.d.mts.map +1 -1
  133. package/resources/top-level.d.ts +19 -15
  134. package/resources/top-level.d.ts.map +1 -1
  135. package/src/client.ts +120 -4
  136. package/src/internal/qs/LICENSE.md +13 -0
  137. package/src/internal/qs/README.md +3 -0
  138. package/src/internal/qs/formats.ts +10 -0
  139. package/src/internal/qs/index.ts +13 -0
  140. package/src/internal/qs/stringify.ts +385 -0
  141. package/src/internal/qs/types.ts +71 -0
  142. package/src/internal/qs/utils.ts +265 -0
  143. package/src/internal/types.ts +6 -8
  144. package/src/internal/utils/query.ts +2 -18
  145. package/src/resources/beta/api.md +9 -5
  146. package/src/resources/beta/beta.ts +26 -20
  147. package/src/resources/beta/findall.ts +153 -202
  148. package/src/resources/beta/index.ts +7 -4
  149. package/src/resources/beta/task-group.ts +30 -157
  150. package/src/resources/beta/task-run.ts +26 -86
  151. package/src/resources/index.ts +42 -0
  152. package/src/resources/monitor.ts +752 -0
  153. package/src/resources/task-group.ts +315 -0
  154. package/src/resources/task-run.ts +122 -95
  155. package/src/resources/top-level.ts +23 -15
  156. package/src/version.ts +1 -1
  157. package/version.d.mts +1 -1
  158. package/version.d.ts +1 -1
  159. package/version.js +1 -1
  160. package/version.mjs +1 -1
@@ -0,0 +1,213 @@
1
+ import { APIResource } from "../core/resource.js";
2
+ import * as TaskRunAPI from "./task-run.js";
3
+ import * as BetaTaskRunAPI from "./beta/task-run.js";
4
+ import { APIPromise } from "../core/api-promise.js";
5
+ import { Stream } from "../core/streaming.js";
6
+ import { RequestOptions } from "../internal/request-options.js";
7
+ /**
8
+ * 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.
9
+ * - Output metadata: citations, excerpts, reasoning, and confidence per field
10
+ *
11
+ * Task Groups enable batch execution of many independent Task runs with group-level monitoring and failure handling.
12
+ * - Submit hundreds or thousands of Tasks as a single group
13
+ * - Observe group progress and receive results as they complete
14
+ * - Real-time updates via Server-Sent Events (SSE)
15
+ * - Add tasks to an existing group while it is running
16
+ * - Group-level retry and error aggregation
17
+ */
18
+ export declare class TaskGroup extends APIResource {
19
+ /**
20
+ * Initiates a TaskGroup to group and track multiple runs.
21
+ */
22
+ create(body: TaskGroupCreateParams, options?: RequestOptions): APIPromise<TaskGroup>;
23
+ /**
24
+ * Retrieves aggregated status across runs in a TaskGroup.
25
+ */
26
+ retrieve(taskGroupID: string, options?: RequestOptions): APIPromise<TaskGroup>;
27
+ /**
28
+ * Initiates multiple task runs within a TaskGroup.
29
+ */
30
+ addRuns(taskGroupID: string, params: TaskGroupAddRunsParams, options?: RequestOptions): APIPromise<TaskGroupRunResponse>;
31
+ /**
32
+ * Streams events from a TaskGroup: status updates and run completions.
33
+ *
34
+ * The connection will remain open for up to an hour as long as at least one run in
35
+ * the group is still active.
36
+ */
37
+ events(taskGroupID: string, query?: TaskGroupEventsParams | undefined, options?: RequestOptions): APIPromise<Stream<TaskGroupEventsResponse>>;
38
+ /**
39
+ * Retrieves task runs in a TaskGroup and optionally their inputs and outputs.
40
+ *
41
+ * All runs within a TaskGroup are returned as a stream. To get the inputs and/or
42
+ * outputs back in the stream, set the corresponding `include_input` and
43
+ * `include_output` parameters to `true`.
44
+ *
45
+ * The stream is resumable using the `event_id` as the cursor. To resume a stream,
46
+ * specify the `last_event_id` parameter with the `event_id` of the last event in
47
+ * the stream. The stream will resume from the next event after the
48
+ * `last_event_id`.
49
+ */
50
+ getRuns(taskGroupID: string, query?: TaskGroupGetRunsParams | undefined, options?: RequestOptions): APIPromise<Stream<TaskGroupGetRunsResponse>>;
51
+ /**
52
+ * Retrieves run status by run_id.
53
+ *
54
+ * This endpoint is equivalent to fetching run status directly using the
55
+ * `retrieve()` method or the `tasks/runs` GET endpoint.
56
+ *
57
+ * The run result is available from the `/result` endpoint.
58
+ */
59
+ retrieveRun(runID: string, params: TaskGroupRetrieveRunParams, options?: RequestOptions): APIPromise<TaskRunAPI.TaskRun>;
60
+ }
61
+ /**
62
+ * Response object for a task group, including its status and metadata.
63
+ */
64
+ export interface TaskGroup {
65
+ /**
66
+ * Timestamp of the creation of the group, as an RFC 3339 string.
67
+ */
68
+ created_at: string | null;
69
+ /**
70
+ * Status of the group.
71
+ */
72
+ status: TaskGroupStatus;
73
+ /**
74
+ * ID of the group.
75
+ */
76
+ taskgroup_id: string;
77
+ /**
78
+ * User-provided metadata stored with the group.
79
+ */
80
+ metadata?: {
81
+ [key: string]: string | number | boolean;
82
+ } | null;
83
+ }
84
+ /**
85
+ * Response from adding new task runs to a task group.
86
+ */
87
+ export interface TaskGroupRunResponse {
88
+ /**
89
+ * Cursor for these runs in the event stream at
90
+ * taskgroup/events?last_event_id=<event_cursor>. Empty for the first runs in the
91
+ * group.
92
+ */
93
+ event_cursor: string | null;
94
+ /**
95
+ * Cursor for these runs in the run stream at
96
+ * taskgroup/runs?last_event_id=<run_cursor>. Empty for the first runs in the
97
+ * group.
98
+ */
99
+ run_cursor: string | null;
100
+ /**
101
+ * IDs of the newly created runs.
102
+ */
103
+ run_ids: Array<string>;
104
+ /**
105
+ * Status of the group.
106
+ */
107
+ status: TaskGroupStatus;
108
+ }
109
+ /**
110
+ * Status of a task group.
111
+ */
112
+ export interface TaskGroupStatus {
113
+ /**
114
+ * True if at least one run in the group is currently active, i.e. status is one of
115
+ * {'cancelling', 'queued', 'running'}.
116
+ */
117
+ is_active: boolean;
118
+ /**
119
+ * Timestamp of the last status update to the group, as an RFC 3339 string.
120
+ */
121
+ modified_at: string | null;
122
+ /**
123
+ * Number of task runs in the group.
124
+ */
125
+ num_task_runs: number;
126
+ /**
127
+ * Human-readable status message for the group.
128
+ */
129
+ status_message: string | null;
130
+ /**
131
+ * Number of task runs with each status.
132
+ */
133
+ task_run_status_counts: {
134
+ [key: string]: number;
135
+ };
136
+ }
137
+ /**
138
+ * Event indicating an update to group status.
139
+ */
140
+ export interface TaskGroupStatusEvent {
141
+ /**
142
+ * Cursor to resume the event stream.
143
+ */
144
+ event_id: string;
145
+ /**
146
+ * Task group status object.
147
+ */
148
+ status: TaskGroupStatus;
149
+ /**
150
+ * Event type; always 'task_group_status'.
151
+ */
152
+ type: 'task_group_status';
153
+ }
154
+ /**
155
+ * Event indicating an update to group status.
156
+ */
157
+ export type TaskGroupEventsResponse = TaskGroupStatusEvent | TaskRunAPI.TaskRunEvent | TaskRunAPI.ErrorEvent;
158
+ /**
159
+ * Event when a task run transitions to a non-active status.
160
+ *
161
+ * May indicate completion, cancellation, or failure.
162
+ */
163
+ export type TaskGroupGetRunsResponse = TaskRunAPI.TaskRunEvent | TaskRunAPI.ErrorEvent;
164
+ export interface TaskGroupCreateParams {
165
+ /**
166
+ * User-provided metadata stored with the task group.
167
+ */
168
+ metadata?: {
169
+ [key: string]: string | number | boolean;
170
+ } | null;
171
+ }
172
+ export interface TaskGroupAddRunsParams {
173
+ /**
174
+ * Body param: List of task runs to execute. Up to 1,000 runs can be specified per
175
+ * request. If you'd like to add more runs, split them across multiple TaskGroup
176
+ * POST requests.
177
+ */
178
+ inputs: Array<TaskRunAPI.RunInput>;
179
+ /**
180
+ * Query param
181
+ */
182
+ refresh_status?: boolean;
183
+ /**
184
+ * Body param: Specification for a task.
185
+ *
186
+ * Auto output schemas can be specified by setting `output_schema={"type":"auto"}`.
187
+ * Not specifying a TaskSpec is the same as setting an auto output schema.
188
+ *
189
+ * For convenience bare strings are also accepted as input or output schemas.
190
+ */
191
+ default_task_spec?: TaskRunAPI.TaskSpec | null;
192
+ /**
193
+ * Header param: Optional header to specify the beta version(s) to enable.
194
+ */
195
+ betas?: Array<BetaTaskRunAPI.ParallelBeta>;
196
+ }
197
+ export interface TaskGroupEventsParams {
198
+ last_event_id?: string | null;
199
+ timeout?: number | null;
200
+ }
201
+ export interface TaskGroupGetRunsParams {
202
+ include_input?: boolean;
203
+ include_output?: boolean;
204
+ last_event_id?: string | null;
205
+ status?: 'queued' | 'action_required' | 'running' | 'completed' | 'failed' | 'cancelling' | 'cancelled' | null;
206
+ }
207
+ export interface TaskGroupRetrieveRunParams {
208
+ taskgroup_id: string;
209
+ }
210
+ export declare namespace TaskGroup {
211
+ export { type TaskGroup as TaskGroup, type TaskGroupRunResponse as TaskGroupRunResponse, type TaskGroupStatus as TaskGroupStatus, type TaskGroupStatusEvent as TaskGroupStatusEvent, type TaskGroupEventsResponse as TaskGroupEventsResponse, type TaskGroupGetRunsResponse as TaskGroupGetRunsResponse, type TaskGroupCreateParams as TaskGroupCreateParams, type TaskGroupAddRunsParams as TaskGroupAddRunsParams, type TaskGroupEventsParams as TaskGroupEventsParams, type TaskGroupGetRunsParams as TaskGroupGetRunsParams, type TaskGroupRetrieveRunParams as TaskGroupRetrieveRunParams, };
212
+ }
213
+ //# sourceMappingURL=task-group.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"task-group.d.ts","sourceRoot":"","sources":["../src/resources/task-group.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,UAAU;OACf,KAAK,cAAc;OACnB,EAAE,UAAU,EAAE;OACd,EAAE,MAAM,EAAE;OAEV,EAAE,cAAc,EAAE;AAGzB;;;;;;;;;;GAUG;AACH,qBAAa,SAAU,SAAQ,WAAW;IACxC;;OAEG;IACH,MAAM,CAAC,IAAI,EAAE,qBAAqB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,SAAS,CAAC;IAIpF;;OAEG;IACH,QAAQ,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,SAAS,CAAC;IAI9E;;OAEG;IACH,OAAO,CACL,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,sBAAsB,EAC9B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,oBAAoB,CAAC;IAanC;;;;;OAKG;IACH,MAAM,CACJ,WAAW,EAAE,MAAM,EACnB,KAA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AAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE9B,MAAM,CAAC,EACH,QAAQ,GACR,iBAAiB,GACjB,SAAS,GACT,WAAW,GACX,QAAQ,GACR,YAAY,GACZ,WAAW,GACX,IAAI,CAAC;CACV;AAED,MAAM,WAAW,0BAA0B;IACzC,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,CAAC,OAAO,WAAW,SAAS,CAAC;IACjC,OAAO,EACL,KAAK,SAAS,IAAI,SAAS,EAC3B,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,eAAe,IAAI,eAAe,EACvC,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,0BAA0B,IAAI,0BAA0B,GAC9D,CAAC;CACH"}
@@ -0,0 +1,95 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.TaskGroup = void 0;
5
+ const resource_1 = require("../core/resource.js");
6
+ const headers_1 = require("../internal/headers.js");
7
+ const path_1 = require("../internal/utils/path.js");
8
+ /**
9
+ * 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.
10
+ * - Output metadata: citations, excerpts, reasoning, and confidence per field
11
+ *
12
+ * Task Groups enable batch execution of many independent Task runs with group-level monitoring and failure handling.
13
+ * - Submit hundreds or thousands of Tasks as a single group
14
+ * - Observe group progress and receive results as they complete
15
+ * - Real-time updates via Server-Sent Events (SSE)
16
+ * - Add tasks to an existing group while it is running
17
+ * - Group-level retry and error aggregation
18
+ */
19
+ class TaskGroup extends resource_1.APIResource {
20
+ /**
21
+ * Initiates a TaskGroup to group and track multiple runs.
22
+ */
23
+ create(body, options) {
24
+ return this._client.post('/v1/tasks/groups', { body, ...options });
25
+ }
26
+ /**
27
+ * Retrieves aggregated status across runs in a TaskGroup.
28
+ */
29
+ retrieve(taskGroupID, options) {
30
+ return this._client.get((0, path_1.path) `/v1/tasks/groups/${taskGroupID}`, options);
31
+ }
32
+ /**
33
+ * Initiates multiple task runs within a TaskGroup.
34
+ */
35
+ addRuns(taskGroupID, params, options) {
36
+ const { refresh_status, betas, ...body } = params;
37
+ return this._client.post((0, path_1.path) `/v1/tasks/groups/${taskGroupID}/runs`, {
38
+ query: { refresh_status },
39
+ body,
40
+ ...options,
41
+ headers: (0, headers_1.buildHeaders)([
42
+ { ...(betas?.toString() != null ? { 'parallel-beta': betas?.toString() } : undefined) },
43
+ options?.headers,
44
+ ]),
45
+ });
46
+ }
47
+ /**
48
+ * Streams events from a TaskGroup: status updates and run completions.
49
+ *
50
+ * The connection will remain open for up to an hour as long as at least one run in
51
+ * the group is still active.
52
+ */
53
+ events(taskGroupID, query = {}, options) {
54
+ return this._client.get((0, path_1.path) `/v1/tasks/groups/${taskGroupID}/events`, {
55
+ query,
56
+ ...options,
57
+ headers: (0, headers_1.buildHeaders)([{ Accept: 'text/event-stream' }, options?.headers]),
58
+ stream: true,
59
+ });
60
+ }
61
+ /**
62
+ * Retrieves task runs in a TaskGroup and optionally their inputs and outputs.
63
+ *
64
+ * All runs within a TaskGroup are returned as a stream. To get the inputs and/or
65
+ * outputs back in the stream, set the corresponding `include_input` and
66
+ * `include_output` parameters to `true`.
67
+ *
68
+ * The stream is resumable using the `event_id` as the cursor. To resume a stream,
69
+ * specify the `last_event_id` parameter with the `event_id` of the last event in
70
+ * the stream. The stream will resume from the next event after the
71
+ * `last_event_id`.
72
+ */
73
+ getRuns(taskGroupID, query = {}, options) {
74
+ return this._client.get((0, path_1.path) `/v1/tasks/groups/${taskGroupID}/runs`, {
75
+ query,
76
+ ...options,
77
+ headers: (0, headers_1.buildHeaders)([{ Accept: 'text/event-stream' }, options?.headers]),
78
+ stream: true,
79
+ });
80
+ }
81
+ /**
82
+ * Retrieves run status by run_id.
83
+ *
84
+ * This endpoint is equivalent to fetching run status directly using the
85
+ * `retrieve()` method or the `tasks/runs` GET endpoint.
86
+ *
87
+ * The run result is available from the `/result` endpoint.
88
+ */
89
+ retrieveRun(runID, params, options) {
90
+ const { taskgroup_id } = params;
91
+ return this._client.get((0, path_1.path) `/v1/tasks/groups/${taskgroup_id}/runs/${runID}`, options);
92
+ }
93
+ }
94
+ exports.TaskGroup = TaskGroup;
95
+ //# sourceMappingURL=task-group.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"task-group.js","sourceRoot":"","sources":["../src/resources/task-group.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAK/C,oDAAmD;AAEnD,oDAA8C;AAE9C;;;;;;;;;;GAUG;AACH,MAAa,SAAU,SAAQ,sBAAW;IACxC;;OAEG;IACH,MAAM,CAAC,IAA2B,EAAE,OAAwB;QAC1D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,kBAAkB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrE,CAAC;IAED;;OAEG;IACH,QAAQ,CAAC,WAAmB,EAAE,OAAwB;QACpD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,oBAAoB,WAAW,EAAE,EAAE,OAAO,CAAC,CAAC;IAC1E,CAAC;IAED;;OAEG;IACH,OAAO,CACL,WAAmB,EACnB,MAA8B,EAC9B,OAAwB;QAExB,MAAM,EAAE,cAAc,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QAClD,OAAO,IAAI,CAAC,OAAO,CA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C;QAChC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,oBAAoB,YAAY,SAAS,KAAK,EAAE,EAAE,OAAO,CAAC,CAAC;IACzF,CAAC;CACF;AA/FD,8BA+FC"}
@@ -0,0 +1,91 @@
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
+ export class TaskGroup extends APIResource {
17
+ /**
18
+ * Initiates a TaskGroup to group and track multiple runs.
19
+ */
20
+ create(body, options) {
21
+ return this._client.post('/v1/tasks/groups', { body, ...options });
22
+ }
23
+ /**
24
+ * Retrieves aggregated status across runs in a TaskGroup.
25
+ */
26
+ retrieve(taskGroupID, options) {
27
+ return this._client.get(path `/v1/tasks/groups/${taskGroupID}`, options);
28
+ }
29
+ /**
30
+ * Initiates multiple task runs within a TaskGroup.
31
+ */
32
+ addRuns(taskGroupID, params, options) {
33
+ const { refresh_status, betas, ...body } = params;
34
+ return this._client.post(path `/v1/tasks/groups/${taskGroupID}/runs`, {
35
+ query: { refresh_status },
36
+ body,
37
+ ...options,
38
+ headers: buildHeaders([
39
+ { ...(betas?.toString() != null ? { 'parallel-beta': betas?.toString() } : undefined) },
40
+ options?.headers,
41
+ ]),
42
+ });
43
+ }
44
+ /**
45
+ * Streams events from a TaskGroup: status updates and run completions.
46
+ *
47
+ * The connection will remain open for up to an hour as long as at least one run in
48
+ * the group is still active.
49
+ */
50
+ events(taskGroupID, query = {}, options) {
51
+ return this._client.get(path `/v1/tasks/groups/${taskGroupID}/events`, {
52
+ query,
53
+ ...options,
54
+ headers: buildHeaders([{ Accept: 'text/event-stream' }, options?.headers]),
55
+ stream: true,
56
+ });
57
+ }
58
+ /**
59
+ * Retrieves task runs in a TaskGroup and optionally their inputs and outputs.
60
+ *
61
+ * All runs within a TaskGroup are returned as a stream. To get the inputs and/or
62
+ * outputs back in the stream, set the corresponding `include_input` and
63
+ * `include_output` parameters to `true`.
64
+ *
65
+ * The stream is resumable using the `event_id` as the cursor. To resume a stream,
66
+ * specify the `last_event_id` parameter with the `event_id` of the last event in
67
+ * the stream. The stream will resume from the next event after the
68
+ * `last_event_id`.
69
+ */
70
+ getRuns(taskGroupID, query = {}, options) {
71
+ return this._client.get(path `/v1/tasks/groups/${taskGroupID}/runs`, {
72
+ query,
73
+ ...options,
74
+ headers: buildHeaders([{ Accept: 'text/event-stream' }, options?.headers]),
75
+ stream: true,
76
+ });
77
+ }
78
+ /**
79
+ * Retrieves run status by run_id.
80
+ *
81
+ * This endpoint is equivalent to fetching run status directly using the
82
+ * `retrieve()` method or the `tasks/runs` GET endpoint.
83
+ *
84
+ * The run result is available from the `/result` endpoint.
85
+ */
86
+ retrieveRun(runID, params, options) {
87
+ const { taskgroup_id } = params;
88
+ return this._client.get(path `/v1/tasks/groups/${taskgroup_id}/runs/${runID}`, options);
89
+ }
90
+ }
91
+ //# sourceMappingURL=task-group.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"task-group.mjs","sourceRoot":"","sources":["../src/resources/task-group.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAKf,EAAE,YAAY,EAAE;OAEhB,EAAE,IA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,EAAE,OAAO,CAAC,CAAC;YAC1E,MAAM,EAAE,IAAI;SACb,CAAgD,CAAC;IACpD,CAAC;IAED;;;;;;;;;;;OAWG;IACH,OAAO,CACL,WAAmB,EACnB,QAA4C,EAAE,EAC9C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,oBAAoB,WAAW,OAAO,EAAE;YAClE,KAAK;YACL,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,mBAAmB,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;YAC1E,MAAM,EAAE,IAAI;SACb,CAAiD,CAAC;IACrD,CAAC;IAED;;;;;;;OAOG;IACH,WAAW,CACT,KAAa,EACb,MAAkC,EAClC,OAAwB;QAExB,MAAM,EAAE,YAAY,EAAE,GAAG,MAAM,CAAC;QAChC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,oBAAoB,YAAY,SAAS,KAAK,EAAE,EAAE,OAAO,CAAC,CAAC;IACzF,CAAC;CACF"}
@@ -9,7 +9,7 @@ import { RequestOptions } from "../internal/request-options.mjs";
9
9
  * - Output metadata: citations, excerpts, reasoning, and confidence per field
10
10
  *
11
11
  * Task Groups enable batch execution of many independent Task runs with group-level monitoring and failure handling.
12
- * - Submit hundreds or thousands of Tasks as a single group
12
+ * - Submit hundreds or thousands of Tasks as a single group
13
13
  * - Observe group progress and receive results as they complete
14
14
  * - Real-time updates via Server-Sent Events (SSE)
15
15
  * - Add tasks to an existing group while it is running
@@ -67,6 +67,17 @@ export declare class TaskRun extends APIResource {
67
67
  * ```
68
68
  */
69
69
  result(runID: string, params?: TaskRunResultParams | null | undefined, options?: RequestOptions): APIPromise<TaskRunResult>;
70
+ /**
71
+ * Retrieves the input of a run by run_id.
72
+ *
73
+ * @example
74
+ * ```ts
75
+ * const runInput = await client.taskRun.retrieveInput(
76
+ * 'run_id',
77
+ * );
78
+ * ```
79
+ */
80
+ retrieveInput(runID: string, options?: RequestOptions): APIPromise<RunInput>;
70
81
  }
71
82
  /**
72
83
  * Auto schema for a task input or output.
@@ -218,7 +229,7 @@ export interface RunInput {
218
229
  /**
219
230
  * Advanced search configuration for a task run.
220
231
  */
221
- advanced_settings?: RunInput.AdvancedSettings | null;
232
+ advanced_settings?: TaskAdvancedSettings | null;
222
233
  /**
223
234
  * Controls tracking of task run execution progress. When set to true, progress
224
235
  * events are recorded and can be accessed via the
@@ -263,16 +274,14 @@ export interface RunInput {
263
274
  */
264
275
  webhook?: Webhook | null;
265
276
  }
266
- export declare namespace RunInput {
277
+ /**
278
+ * Advanced search configuration for a task run.
279
+ */
280
+ export interface TaskAdvancedSettings {
267
281
  /**
268
- * Advanced search configuration for a task run.
282
+ * ISO 3166-1 alpha-2 country code for geo-targeted search results.
269
283
  */
270
- interface AdvancedSettings {
271
- /**
272
- * ISO 3166-1 alpha-2 country code for geo-targeted search results.
273
- */
274
- location?: string | null;
275
- }
284
+ location?: string | null;
276
285
  }
277
286
  /**
278
287
  * Status of a task run.
@@ -395,6 +404,41 @@ export interface TaskRunJsonOutput {
395
404
  [key: string]: unknown;
396
405
  } | null;
397
406
  }
407
+ /**
408
+ * A message for a task run progress update.
409
+ */
410
+ export interface TaskRunProgressMessageEvent {
411
+ /**
412
+ * Progress update message.
413
+ */
414
+ message: string;
415
+ /**
416
+ * Timestamp of the message.
417
+ */
418
+ timestamp: string | null;
419
+ /**
420
+ * Event type; always starts with 'task_run.progress_msg'.
421
+ */
422
+ type: 'task_run.progress_msg.plan' | 'task_run.progress_msg.search' | 'task_run.progress_msg.result' | 'task_run.progress_msg.tool_call' | 'task_run.progress_msg.exec_status';
423
+ }
424
+ /**
425
+ * A progress update for a task run.
426
+ */
427
+ export interface TaskRunProgressStatsEvent {
428
+ /**
429
+ * Completion percentage of the task run. Ranges from 0 to 100 where 0 indicates no
430
+ * progress and 100 indicates completion.
431
+ */
432
+ progress_meter: number;
433
+ /**
434
+ * Source stats describing progress so far.
435
+ */
436
+ source_stats: TaskRunSourceStats;
437
+ /**
438
+ * Event type; always 'task_run.progress_stats'.
439
+ */
440
+ type: 'task_run.progress_stats';
441
+ }
398
442
  /**
399
443
  * Result of a task run.
400
444
  */
@@ -408,6 +452,23 @@ export interface TaskRunResult {
408
452
  */
409
453
  run: TaskRun;
410
454
  }
455
+ /**
456
+ * Source stats for a task run.
457
+ */
458
+ export interface TaskRunSourceStats {
459
+ /**
460
+ * Number of sources considered in processing the task.
461
+ */
462
+ num_sources_considered: number | null;
463
+ /**
464
+ * Number of sources read in processing the task.
465
+ */
466
+ num_sources_read: number | null;
467
+ /**
468
+ * A sample of URLs of sources read in processing the task.
469
+ */
470
+ sources_read_sample: Array<string> | null;
471
+ }
411
472
  /**
412
473
  * Output from a task that returns text.
413
474
  */
@@ -488,63 +549,7 @@ export interface Webhook {
488
549
  /**
489
550
  * A progress update for a task run.
490
551
  */
491
- export type TaskRunEventsResponse = TaskRunEventsResponse.TaskRunProgressStatsEvent | TaskRunEventsResponse.TaskRunProgressMessageEvent | TaskRunEvent | ErrorEvent;
492
- export declare namespace TaskRunEventsResponse {
493
- /**
494
- * A progress update for a task run.
495
- */
496
- interface TaskRunProgressStatsEvent {
497
- /**
498
- * Completion percentage of the task run. Ranges from 0 to 100 where 0 indicates no
499
- * progress and 100 indicates completion.
500
- */
501
- progress_meter: number;
502
- /**
503
- * Source stats describing progress so far.
504
- */
505
- source_stats: TaskRunProgressStatsEvent.SourceStats;
506
- /**
507
- * Event type; always 'task_run.progress_stats'.
508
- */
509
- type: 'task_run.progress_stats';
510
- }
511
- namespace TaskRunProgressStatsEvent {
512
- /**
513
- * Source stats describing progress so far.
514
- */
515
- interface SourceStats {
516
- /**
517
- * Number of sources considered in processing the task.
518
- */
519
- num_sources_considered: number | null;
520
- /**
521
- * Number of sources read in processing the task.
522
- */
523
- num_sources_read: number | null;
524
- /**
525
- * A sample of URLs of sources read in processing the task.
526
- */
527
- sources_read_sample: Array<string> | null;
528
- }
529
- }
530
- /**
531
- * A message for a task run progress update.
532
- */
533
- interface TaskRunProgressMessageEvent {
534
- /**
535
- * Progress update message.
536
- */
537
- message: string;
538
- /**
539
- * Timestamp of the message.
540
- */
541
- timestamp: string | null;
542
- /**
543
- * Event type; always starts with 'task_run.progress_msg'.
544
- */
545
- type: 'task_run.progress_msg.plan' | 'task_run.progress_msg.search' | 'task_run.progress_msg.result' | 'task_run.progress_msg.tool_call' | 'task_run.progress_msg.exec_status';
546
- }
547
- }
552
+ export type TaskRunEventsResponse = TaskRunProgressStatsEvent | TaskRunProgressMessageEvent | TaskRunEvent | ErrorEvent;
548
553
  export interface TaskRunCreateParams {
549
554
  /**
550
555
  * Body param: Input to the task, either text or a JSON object.
@@ -559,7 +564,7 @@ export interface TaskRunCreateParams {
559
564
  /**
560
565
  * Body param: Advanced search configuration for a task run.
561
566
  */
562
- advanced_settings?: TaskRunCreateParams.AdvancedSettings | null;
567
+ advanced_settings?: TaskAdvancedSettings | null;
563
568
  /**
564
569
  * Body param: Controls tracking of task run execution progress. When set to true,
565
570
  * progress events are recorded and can be accessed via the
@@ -608,17 +613,6 @@ export interface TaskRunCreateParams {
608
613
  */
609
614
  betas?: Array<BetaTaskRunAPI.ParallelBeta>;
610
615
  }
611
- export declare namespace TaskRunCreateParams {
612
- /**
613
- * Advanced search configuration for a task run.
614
- */
615
- interface AdvancedSettings {
616
- /**
617
- * ISO 3166-1 alpha-2 country code for geo-targeted search results.
618
- */
619
- location?: string | null;
620
- }
621
- }
622
616
  export interface TaskRunResultParams {
623
617
  /**
624
618
  * Query param
@@ -630,6 +624,29 @@ export interface TaskRunResultParams {
630
624
  betas?: Array<BetaTaskRunAPI.ParallelBeta>;
631
625
  }
632
626
  export declare namespace TaskRun {
633
- export { type AutoSchema as AutoSchema, type Citation as Citation, type ErrorEvent as ErrorEvent, type FieldBasis as FieldBasis, type JsonSchema as JsonSchema, type McpServer as McpServer, type McpToolCall as McpToolCall, type RunInput as RunInput, type TaskRun as TaskRun, type TaskRunEvent as TaskRunEvent, type TaskRunJsonOutput as TaskRunJsonOutput, type TaskRunResult as TaskRunResult, type TaskRunTextOutput as TaskRunTextOutput, type TaskSpec as TaskSpec, type TextSchema as TextSchema, type Webhook as Webhook, type TaskRunEventsResponse as TaskRunEventsResponse, type TaskRunCreateParams as TaskRunCreateParams, type TaskRunResultParams as TaskRunResultParams, };
627
+ export { type AutoSchema as AutoSchema, type Citation as Citation, type ErrorEvent as ErrorEvent, type FieldBasis as FieldBasis, type JsonSchema as JsonSchema, type McpServer as McpServer, type McpToolCall as McpToolCall, type RunInput as RunInput, type TaskAdvancedSettings as TaskAdvancedSettings, type TaskRun as TaskRun, type TaskRunEvent as TaskRunEvent, type TaskRunJsonOutput as TaskRunJsonOutput, type TaskRunProgressMessageEvent as TaskRunProgressMessageEvent, type TaskRunProgressStatsEvent as TaskRunProgressStatsEvent, type TaskRunResult as TaskRunResult, type TaskRunSourceStats as TaskRunSourceStats, type TaskRunTextOutput as TaskRunTextOutput, type TaskSpec as TaskSpec, type TextSchema as TextSchema, type Webhook as Webhook, type TaskRunEventsResponse as TaskRunEventsResponse, type TaskRunCreateParams as TaskRunCreateParams, type TaskRunResultParams as TaskRunResultParams, };
628
+ }
629
+ type _TaskAdvancedSettings = TaskAdvancedSettings;
630
+ type _TaskRunProgressMessageEvent = TaskRunProgressMessageEvent;
631
+ type _TaskRunProgressStatsEvent = TaskRunProgressStatsEvent;
632
+ type _TaskRunSourceStats = TaskRunSourceStats;
633
+ export declare namespace RunInput {
634
+ /** @deprecated Use the top-level `TaskAdvancedSettings` instead. */
635
+ type AdvancedSettings = _TaskAdvancedSettings;
636
+ }
637
+ export declare namespace TaskRunCreateParams {
638
+ /** @deprecated Use the top-level `TaskAdvancedSettings` instead. */
639
+ type AdvancedSettings = _TaskAdvancedSettings;
640
+ }
641
+ export declare namespace TaskRunEventsResponse {
642
+ /** @deprecated Use the top-level `TaskRunProgressMessageEvent` instead. */
643
+ type TaskRunProgressMessageEvent = _TaskRunProgressMessageEvent;
644
+ /** @deprecated Use the top-level `TaskRunProgressStatsEvent` instead. */
645
+ type TaskRunProgressStatsEvent = _TaskRunProgressStatsEvent;
646
+ namespace TaskRunProgressStatsEvent {
647
+ /** @deprecated Use the top-level `TaskRunSourceStats` instead. */
648
+ type SourceStats = _TaskRunSourceStats;
649
+ }
634
650
  }
651
+ export {};
635
652
  //# sourceMappingURL=task-run.d.mts.map