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.
- package/CHANGELOG.md +26 -0
- 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/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/types.d.mts +6 -6
- package/internal/types.d.mts.map +1 -1
- package/internal/types.d.ts +6 -6
- package/internal/types.d.ts.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/package.json +1 -1
- package/resources/beta/beta.d.mts +11 -19
- package/resources/beta/beta.d.mts.map +1 -1
- package/resources/beta/beta.d.ts +11 -19
- package/resources/beta/beta.d.ts.map +1 -1
- package/resources/beta/beta.js +2 -0
- package/resources/beta/beta.js.map +1 -1
- package/resources/beta/beta.mjs +2 -0
- package/resources/beta/beta.mjs.map +1 -1
- package/resources/beta/findall.d.mts +127 -177
- package/resources/beta/findall.d.mts.map +1 -1
- package/resources/beta/findall.d.ts +127 -177
- package/resources/beta/findall.d.ts.map +1 -1
- package/resources/beta/findall.js +2 -4
- package/resources/beta/findall.js.map +1 -1
- package/resources/beta/findall.mjs +2 -4
- 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 +22 -143
- package/resources/beta/task-group.d.mts.map +1 -1
- package/resources/beta/task-group.d.ts +22 -143
- package/resources/beta/task-group.d.ts.map +1 -1
- package/resources/beta/task-group.js +7 -42
- package/resources/beta/task-group.js.map +1 -1
- package/resources/beta/task-group.mjs +7 -42
- package/resources/beta/task-group.mjs.map +1 -1
- package/resources/beta/task-run.d.mts +22 -70
- package/resources/beta/task-run.d.mts.map +1 -1
- package/resources/beta/task-run.d.ts +22 -70
- package/resources/beta/task-run.d.ts.map +1 -1
- package/resources/beta/task-run.js +1 -1
- package/resources/beta/task-run.mjs +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/task-group.d.mts +213 -0
- package/resources/task-group.d.mts.map +1 -0
- package/resources/task-group.d.ts +213 -0
- package/resources/task-group.d.ts.map +1 -0
- package/resources/task-group.js +95 -0
- package/resources/task-group.js.map +1 -0
- package/resources/task-group.mjs +91 -0
- package/resources/task-group.mjs.map +1 -0
- package/resources/task-run.d.mts +97 -80
- package/resources/task-run.d.mts.map +1 -1
- package/resources/task-run.d.ts +97 -80
- 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 +19 -15
- package/resources/top-level.d.mts.map +1 -1
- package/resources/top-level.d.ts +19 -15
- package/resources/top-level.d.ts.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/query.ts +2 -18
- package/src/resources/beta/api.md +9 -5
- package/src/resources/beta/beta.ts +26 -20
- package/src/resources/beta/findall.ts +153 -202
- package/src/resources/beta/index.ts +7 -4
- package/src/resources/beta/task-group.ts +30 -157
- package/src/resources/beta/task-run.ts +26 -86
- package/src/resources/index.ts +42 -0
- package/src/resources/monitor.ts +752 -0
- package/src/resources/task-group.ts +315 -0
- package/src/resources/task-run.ts +122 -95
- package/src/resources/top-level.ts +23 -15
- 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,71 +1,41 @@
|
|
|
1
1
|
import { APIResource } from "../../core/resource.mjs";
|
|
2
|
-
import * as TaskGroupAPI from "
|
|
2
|
+
import * as TaskGroupAPI from "../task-group.mjs";
|
|
3
3
|
import * as TaskRunAPI from "../task-run.mjs";
|
|
4
4
|
import * as BetaTaskRunAPI from "./task-run.mjs";
|
|
5
5
|
import { APIPromise } from "../../core/api-promise.mjs";
|
|
6
6
|
import { Stream } from "../../core/streaming.mjs";
|
|
7
7
|
import { RequestOptions } from "../../internal/request-options.mjs";
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
10
|
-
* - Output metadata: citations, excerpts, reasoning, and confidence per field
|
|
9
|
+
* Tasks (Beta)
|
|
11
10
|
*
|
|
12
|
-
*
|
|
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
|
|
11
|
+
* @deprecated Use GA Task Group instead
|
|
18
12
|
*/
|
|
19
13
|
export declare class TaskGroup extends APIResource {
|
|
20
14
|
/**
|
|
21
15
|
* Initiates a TaskGroup to group and track multiple runs.
|
|
22
16
|
*
|
|
23
|
-
* @
|
|
24
|
-
* ```ts
|
|
25
|
-
* const taskGroup = await client.beta.taskGroup.create();
|
|
26
|
-
* ```
|
|
17
|
+
* @deprecated Use GA Task Group instead
|
|
27
18
|
*/
|
|
28
|
-
create(body: TaskGroupCreateParams, options?: RequestOptions): APIPromise<TaskGroup>;
|
|
19
|
+
create(body: TaskGroupCreateParams, options?: RequestOptions): APIPromise<TaskGroupAPI.TaskGroup>;
|
|
29
20
|
/**
|
|
30
21
|
* Retrieves aggregated status across runs in a TaskGroup.
|
|
31
22
|
*
|
|
32
|
-
* @
|
|
33
|
-
* ```ts
|
|
34
|
-
* const taskGroup = await client.beta.taskGroup.retrieve(
|
|
35
|
-
* 'taskgroup_id',
|
|
36
|
-
* );
|
|
37
|
-
* ```
|
|
23
|
+
* @deprecated Use GA Task Group instead
|
|
38
24
|
*/
|
|
39
|
-
retrieve(taskGroupID: string, options?: RequestOptions): APIPromise<TaskGroup>;
|
|
25
|
+
retrieve(taskGroupID: string, options?: RequestOptions): APIPromise<TaskGroupAPI.TaskGroup>;
|
|
40
26
|
/**
|
|
41
27
|
* Initiates multiple task runs within a TaskGroup.
|
|
42
28
|
*
|
|
43
|
-
* @
|
|
44
|
-
* ```ts
|
|
45
|
-
* const taskGroupRunResponse =
|
|
46
|
-
* await client.beta.taskGroup.addRuns('taskgroup_id', {
|
|
47
|
-
* inputs: [
|
|
48
|
-
* {
|
|
49
|
-
* input: 'What was the GDP of France in 2023?',
|
|
50
|
-
* processor: 'base',
|
|
51
|
-
* },
|
|
52
|
-
* ],
|
|
53
|
-
* });
|
|
54
|
-
* ```
|
|
29
|
+
* @deprecated Use GA Task Group instead
|
|
55
30
|
*/
|
|
56
|
-
addRuns(taskGroupID: string, params: TaskGroupAddRunsParams, options?: RequestOptions): APIPromise<TaskGroupRunResponse>;
|
|
31
|
+
addRuns(taskGroupID: string, params: TaskGroupAddRunsParams, options?: RequestOptions): APIPromise<TaskGroupAPI.TaskGroupRunResponse>;
|
|
57
32
|
/**
|
|
58
33
|
* Streams events from a TaskGroup: status updates and run completions.
|
|
59
34
|
*
|
|
60
35
|
* The connection will remain open for up to an hour as long as at least one run in
|
|
61
36
|
* the group is still active.
|
|
62
37
|
*
|
|
63
|
-
* @
|
|
64
|
-
* ```ts
|
|
65
|
-
* const response = await client.beta.taskGroup.events(
|
|
66
|
-
* 'taskgroup_id',
|
|
67
|
-
* );
|
|
68
|
-
* ```
|
|
38
|
+
* @deprecated Use GA Task Group instead
|
|
69
39
|
*/
|
|
70
40
|
events(taskGroupID: string, query?: TaskGroupEventsParams | undefined, options?: RequestOptions): APIPromise<Stream<TaskGroupEventsResponse>>;
|
|
71
41
|
/**
|
|
@@ -80,120 +50,23 @@ export declare class TaskGroup extends APIResource {
|
|
|
80
50
|
* the stream. The stream will resume from the next event after the
|
|
81
51
|
* `last_event_id`.
|
|
82
52
|
*
|
|
83
|
-
* @
|
|
84
|
-
* ```ts
|
|
85
|
-
* const response = await client.beta.taskGroup.getRuns(
|
|
86
|
-
* 'taskgroup_id',
|
|
87
|
-
* );
|
|
88
|
-
* ```
|
|
53
|
+
* @deprecated Use GA Task Group instead
|
|
89
54
|
*/
|
|
90
55
|
getRuns(taskGroupID: string, query?: TaskGroupGetRunsParams | undefined, options?: RequestOptions): APIPromise<Stream<TaskGroupGetRunsResponse>>;
|
|
91
56
|
}
|
|
92
|
-
/**
|
|
93
|
-
* Response object for a task group, including its status and metadata.
|
|
94
|
-
*/
|
|
95
|
-
export interface TaskGroup {
|
|
96
|
-
/**
|
|
97
|
-
* Timestamp of the creation of the group, as an RFC 3339 string.
|
|
98
|
-
*/
|
|
99
|
-
created_at: string | null;
|
|
100
|
-
/**
|
|
101
|
-
* Status of the group.
|
|
102
|
-
*/
|
|
103
|
-
status: TaskGroupStatus;
|
|
104
|
-
/**
|
|
105
|
-
* ID of the group.
|
|
106
|
-
*/
|
|
107
|
-
taskgroup_id: string;
|
|
108
|
-
/**
|
|
109
|
-
* User-provided metadata stored with the group.
|
|
110
|
-
*/
|
|
111
|
-
metadata?: {
|
|
112
|
-
[key: string]: string | number | boolean;
|
|
113
|
-
} | null;
|
|
114
|
-
}
|
|
115
|
-
/**
|
|
116
|
-
* Response from adding new task runs to a task group.
|
|
117
|
-
*/
|
|
118
|
-
export interface TaskGroupRunResponse {
|
|
119
|
-
/**
|
|
120
|
-
* Cursor for these runs in the event stream at
|
|
121
|
-
* taskgroup/events?last_event_id=<event_cursor>. Empty for the first runs in the
|
|
122
|
-
* group.
|
|
123
|
-
*/
|
|
124
|
-
event_cursor: string | null;
|
|
125
|
-
/**
|
|
126
|
-
* Cursor for these runs in the run stream at
|
|
127
|
-
* taskgroup/runs?last_event_id=<run_cursor>. Empty for the first runs in the
|
|
128
|
-
* group.
|
|
129
|
-
*/
|
|
130
|
-
run_cursor: string | null;
|
|
131
|
-
/**
|
|
132
|
-
* IDs of the newly created runs.
|
|
133
|
-
*/
|
|
134
|
-
run_ids: Array<string>;
|
|
135
|
-
/**
|
|
136
|
-
* Status of the group.
|
|
137
|
-
*/
|
|
138
|
-
status: TaskGroupStatus;
|
|
139
|
-
}
|
|
140
|
-
/**
|
|
141
|
-
* Status of a task group.
|
|
142
|
-
*/
|
|
143
|
-
export interface TaskGroupStatus {
|
|
144
|
-
/**
|
|
145
|
-
* True if at least one run in the group is currently active, i.e. status is one of
|
|
146
|
-
* {'cancelling', 'queued', 'running'}.
|
|
147
|
-
*/
|
|
148
|
-
is_active: boolean;
|
|
149
|
-
/**
|
|
150
|
-
* Timestamp of the last status update to the group, as an RFC 3339 string.
|
|
151
|
-
*/
|
|
152
|
-
modified_at: string | null;
|
|
153
|
-
/**
|
|
154
|
-
* Number of task runs in the group.
|
|
155
|
-
*/
|
|
156
|
-
num_task_runs: number;
|
|
157
|
-
/**
|
|
158
|
-
* Human-readable status message for the group.
|
|
159
|
-
*/
|
|
160
|
-
status_message: string | null;
|
|
161
|
-
/**
|
|
162
|
-
* Number of task runs with each status.
|
|
163
|
-
*/
|
|
164
|
-
task_run_status_counts: {
|
|
165
|
-
[key: string]: number;
|
|
166
|
-
};
|
|
167
|
-
}
|
|
168
57
|
/**
|
|
169
58
|
* Event indicating an update to group status.
|
|
170
59
|
*/
|
|
171
|
-
export type TaskGroupEventsResponse =
|
|
172
|
-
export declare namespace TaskGroupEventsResponse {
|
|
173
|
-
/**
|
|
174
|
-
* Event indicating an update to group status.
|
|
175
|
-
*/
|
|
176
|
-
interface TaskGroupStatusEvent {
|
|
177
|
-
/**
|
|
178
|
-
* Cursor to resume the event stream.
|
|
179
|
-
*/
|
|
180
|
-
event_id: string;
|
|
181
|
-
/**
|
|
182
|
-
* Task group status object.
|
|
183
|
-
*/
|
|
184
|
-
status: TaskGroupAPI.TaskGroupStatus;
|
|
185
|
-
/**
|
|
186
|
-
* Event type; always 'task_group_status'.
|
|
187
|
-
*/
|
|
188
|
-
type: 'task_group_status';
|
|
189
|
-
}
|
|
190
|
-
}
|
|
60
|
+
export type TaskGroupEventsResponse = TaskGroupAPI.TaskGroupStatusEvent | TaskRunAPI.TaskRunEvent | TaskRunAPI.ErrorEvent;
|
|
191
61
|
/**
|
|
192
62
|
* Event when a task run transitions to a non-active status.
|
|
193
63
|
*
|
|
194
64
|
* May indicate completion, cancellation, or failure.
|
|
195
65
|
*/
|
|
196
66
|
export type TaskGroupGetRunsResponse = TaskRunAPI.TaskRunEvent | TaskRunAPI.ErrorEvent;
|
|
67
|
+
export type TaskGroupStatus = TaskGroupAPI.TaskGroupStatus;
|
|
68
|
+
export type TaskGroupStatusEvent = TaskGroupAPI.TaskGroupStatusEvent;
|
|
69
|
+
export type TaskGroupRunResponse = TaskGroupAPI.TaskGroupRunResponse;
|
|
197
70
|
export interface TaskGroupCreateParams {
|
|
198
71
|
/**
|
|
199
72
|
* User-provided metadata stored with the task group.
|
|
@@ -238,6 +111,12 @@ export interface TaskGroupGetRunsParams {
|
|
|
238
111
|
status?: 'queued' | 'action_required' | 'running' | 'completed' | 'failed' | 'cancelling' | 'cancelled' | null;
|
|
239
112
|
}
|
|
240
113
|
export declare namespace TaskGroup {
|
|
241
|
-
export { type
|
|
114
|
+
export { type TaskGroupEventsResponse as TaskGroupEventsResponse, type TaskGroupGetRunsResponse as TaskGroupGetRunsResponse, type TaskGroupStatus as TaskGroupStatus, type TaskGroupStatusEvent as TaskGroupStatusEvent, type TaskGroupRunResponse as TaskGroupRunResponse, type TaskGroupCreateParams as TaskGroupCreateParams, type TaskGroupAddRunsParams as TaskGroupAddRunsParams, type TaskGroupEventsParams as TaskGroupEventsParams, type TaskGroupGetRunsParams as TaskGroupGetRunsParams, };
|
|
115
|
+
}
|
|
116
|
+
type _TaskGroupStatusEvent = TaskGroupStatusEvent;
|
|
117
|
+
export declare namespace TaskGroupEventsResponse {
|
|
118
|
+
/** @deprecated Use `Beta.TaskGroupStatusEvent` instead. */
|
|
119
|
+
type TaskGroupStatusEvent = _TaskGroupStatusEvent;
|
|
242
120
|
}
|
|
121
|
+
export {};
|
|
243
122
|
//# sourceMappingURL=task-group.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task-group.d.mts","sourceRoot":"","sources":["../../src/resources/beta/task-group.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,YAAY;OACjB,KAAK,UAAU;OACf,KAAK,cAAc;OACnB,EAAE,UAAU,EAAE;OACd,EAAE,MAAM,EAAE;OAEV,EAAE,cAAc,EAAE;AAGzB
|
|
1
|
+
{"version":3,"file":"task-group.d.mts","sourceRoot":"","sources":["../../src/resources/beta/task-group.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,YAAY;OACjB,KAAK,UAAU;OACf,KAAK,cAAc;OACnB,EAAE,UAAU,EAAE;OACd,EAAE,MAAM,EAAE;OAEV,EAAE,cAAc,EAAE;AAGzB;;;;GAIG;AACH,qBAAa,SAAU,SAAQ,WAAW;IACxC;;;;OAIG;IACH,MAAM,CAAC,IAAI,EAAE,qBAAqB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,YAAY,CAAC,SAAS,CAAC;IAQjG;;;;O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} from "../../core/resource.js";
|
|
2
|
-
import * as TaskGroupAPI from "
|
|
2
|
+
import * as TaskGroupAPI from "../task-group.js";
|
|
3
3
|
import * as TaskRunAPI from "../task-run.js";
|
|
4
4
|
import * as BetaTaskRunAPI from "./task-run.js";
|
|
5
5
|
import { APIPromise } from "../../core/api-promise.js";
|
|
6
6
|
import { Stream } from "../../core/streaming.js";
|
|
7
7
|
import { RequestOptions } from "../../internal/request-options.js";
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
10
|
-
* - Output metadata: citations, excerpts, reasoning, and confidence per field
|
|
9
|
+
* Tasks (Beta)
|
|
11
10
|
*
|
|
12
|
-
*
|
|
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
|
|
11
|
+
* @deprecated Use GA Task Group instead
|
|
18
12
|
*/
|
|
19
13
|
export declare class TaskGroup extends APIResource {
|
|
20
14
|
/**
|
|
21
15
|
* Initiates a TaskGroup to group and track multiple runs.
|
|
22
16
|
*
|
|
23
|
-
* @
|
|
24
|
-
* ```ts
|
|
25
|
-
* const taskGroup = await client.beta.taskGroup.create();
|
|
26
|
-
* ```
|
|
17
|
+
* @deprecated Use GA Task Group instead
|
|
27
18
|
*/
|
|
28
|
-
create(body: TaskGroupCreateParams, options?: RequestOptions): APIPromise<TaskGroup>;
|
|
19
|
+
create(body: TaskGroupCreateParams, options?: RequestOptions): APIPromise<TaskGroupAPI.TaskGroup>;
|
|
29
20
|
/**
|
|
30
21
|
* Retrieves aggregated status across runs in a TaskGroup.
|
|
31
22
|
*
|
|
32
|
-
* @
|
|
33
|
-
* ```ts
|
|
34
|
-
* const taskGroup = await client.beta.taskGroup.retrieve(
|
|
35
|
-
* 'taskgroup_id',
|
|
36
|
-
* );
|
|
37
|
-
* ```
|
|
23
|
+
* @deprecated Use GA Task Group instead
|
|
38
24
|
*/
|
|
39
|
-
retrieve(taskGroupID: string, options?: RequestOptions): APIPromise<TaskGroup>;
|
|
25
|
+
retrieve(taskGroupID: string, options?: RequestOptions): APIPromise<TaskGroupAPI.TaskGroup>;
|
|
40
26
|
/**
|
|
41
27
|
* Initiates multiple task runs within a TaskGroup.
|
|
42
28
|
*
|
|
43
|
-
* @
|
|
44
|
-
* ```ts
|
|
45
|
-
* const taskGroupRunResponse =
|
|
46
|
-
* await client.beta.taskGroup.addRuns('taskgroup_id', {
|
|
47
|
-
* inputs: [
|
|
48
|
-
* {
|
|
49
|
-
* input: 'What was the GDP of France in 2023?',
|
|
50
|
-
* processor: 'base',
|
|
51
|
-
* },
|
|
52
|
-
* ],
|
|
53
|
-
* });
|
|
54
|
-
* ```
|
|
29
|
+
* @deprecated Use GA Task Group instead
|
|
55
30
|
*/
|
|
56
|
-
addRuns(taskGroupID: string, params: TaskGroupAddRunsParams, options?: RequestOptions): APIPromise<TaskGroupRunResponse>;
|
|
31
|
+
addRuns(taskGroupID: string, params: TaskGroupAddRunsParams, options?: RequestOptions): APIPromise<TaskGroupAPI.TaskGroupRunResponse>;
|
|
57
32
|
/**
|
|
58
33
|
* Streams events from a TaskGroup: status updates and run completions.
|
|
59
34
|
*
|
|
60
35
|
* The connection will remain open for up to an hour as long as at least one run in
|
|
61
36
|
* the group is still active.
|
|
62
37
|
*
|
|
63
|
-
* @
|
|
64
|
-
* ```ts
|
|
65
|
-
* const response = await client.beta.taskGroup.events(
|
|
66
|
-
* 'taskgroup_id',
|
|
67
|
-
* );
|
|
68
|
-
* ```
|
|
38
|
+
* @deprecated Use GA Task Group instead
|
|
69
39
|
*/
|
|
70
40
|
events(taskGroupID: string, query?: TaskGroupEventsParams | undefined, options?: RequestOptions): APIPromise<Stream<TaskGroupEventsResponse>>;
|
|
71
41
|
/**
|
|
@@ -80,120 +50,23 @@ export declare class TaskGroup extends APIResource {
|
|
|
80
50
|
* the stream. The stream will resume from the next event after the
|
|
81
51
|
* `last_event_id`.
|
|
82
52
|
*
|
|
83
|
-
* @
|
|
84
|
-
* ```ts
|
|
85
|
-
* const response = await client.beta.taskGroup.getRuns(
|
|
86
|
-
* 'taskgroup_id',
|
|
87
|
-
* );
|
|
88
|
-
* ```
|
|
53
|
+
* @deprecated Use GA Task Group instead
|
|
89
54
|
*/
|
|
90
55
|
getRuns(taskGroupID: string, query?: TaskGroupGetRunsParams | undefined, options?: RequestOptions): APIPromise<Stream<TaskGroupGetRunsResponse>>;
|
|
91
56
|
}
|
|
92
|
-
/**
|
|
93
|
-
* Response object for a task group, including its status and metadata.
|
|
94
|
-
*/
|
|
95
|
-
export interface TaskGroup {
|
|
96
|
-
/**
|
|
97
|
-
* Timestamp of the creation of the group, as an RFC 3339 string.
|
|
98
|
-
*/
|
|
99
|
-
created_at: string | null;
|
|
100
|
-
/**
|
|
101
|
-
* Status of the group.
|
|
102
|
-
*/
|
|
103
|
-
status: TaskGroupStatus;
|
|
104
|
-
/**
|
|
105
|
-
* ID of the group.
|
|
106
|
-
*/
|
|
107
|
-
taskgroup_id: string;
|
|
108
|
-
/**
|
|
109
|
-
* User-provided metadata stored with the group.
|
|
110
|
-
*/
|
|
111
|
-
metadata?: {
|
|
112
|
-
[key: string]: string | number | boolean;
|
|
113
|
-
} | null;
|
|
114
|
-
}
|
|
115
|
-
/**
|
|
116
|
-
* Response from adding new task runs to a task group.
|
|
117
|
-
*/
|
|
118
|
-
export interface TaskGroupRunResponse {
|
|
119
|
-
/**
|
|
120
|
-
* Cursor for these runs in the event stream at
|
|
121
|
-
* taskgroup/events?last_event_id=<event_cursor>. Empty for the first runs in the
|
|
122
|
-
* group.
|
|
123
|
-
*/
|
|
124
|
-
event_cursor: string | null;
|
|
125
|
-
/**
|
|
126
|
-
* Cursor for these runs in the run stream at
|
|
127
|
-
* taskgroup/runs?last_event_id=<run_cursor>. Empty for the first runs in the
|
|
128
|
-
* group.
|
|
129
|
-
*/
|
|
130
|
-
run_cursor: string | null;
|
|
131
|
-
/**
|
|
132
|
-
* IDs of the newly created runs.
|
|
133
|
-
*/
|
|
134
|
-
run_ids: Array<string>;
|
|
135
|
-
/**
|
|
136
|
-
* Status of the group.
|
|
137
|
-
*/
|
|
138
|
-
status: TaskGroupStatus;
|
|
139
|
-
}
|
|
140
|
-
/**
|
|
141
|
-
* Status of a task group.
|
|
142
|
-
*/
|
|
143
|
-
export interface TaskGroupStatus {
|
|
144
|
-
/**
|
|
145
|
-
* True if at least one run in the group is currently active, i.e. status is one of
|
|
146
|
-
* {'cancelling', 'queued', 'running'}.
|
|
147
|
-
*/
|
|
148
|
-
is_active: boolean;
|
|
149
|
-
/**
|
|
150
|
-
* Timestamp of the last status update to the group, as an RFC 3339 string.
|
|
151
|
-
*/
|
|
152
|
-
modified_at: string | null;
|
|
153
|
-
/**
|
|
154
|
-
* Number of task runs in the group.
|
|
155
|
-
*/
|
|
156
|
-
num_task_runs: number;
|
|
157
|
-
/**
|
|
158
|
-
* Human-readable status message for the group.
|
|
159
|
-
*/
|
|
160
|
-
status_message: string | null;
|
|
161
|
-
/**
|
|
162
|
-
* Number of task runs with each status.
|
|
163
|
-
*/
|
|
164
|
-
task_run_status_counts: {
|
|
165
|
-
[key: string]: number;
|
|
166
|
-
};
|
|
167
|
-
}
|
|
168
57
|
/**
|
|
169
58
|
* Event indicating an update to group status.
|
|
170
59
|
*/
|
|
171
|
-
export type TaskGroupEventsResponse =
|
|
172
|
-
export declare namespace TaskGroupEventsResponse {
|
|
173
|
-
/**
|
|
174
|
-
* Event indicating an update to group status.
|
|
175
|
-
*/
|
|
176
|
-
interface TaskGroupStatusEvent {
|
|
177
|
-
/**
|
|
178
|
-
* Cursor to resume the event stream.
|
|
179
|
-
*/
|
|
180
|
-
event_id: string;
|
|
181
|
-
/**
|
|
182
|
-
* Task group status object.
|
|
183
|
-
*/
|
|
184
|
-
status: TaskGroupAPI.TaskGroupStatus;
|
|
185
|
-
/**
|
|
186
|
-
* Event type; always 'task_group_status'.
|
|
187
|
-
*/
|
|
188
|
-
type: 'task_group_status';
|
|
189
|
-
}
|
|
190
|
-
}
|
|
60
|
+
export type TaskGroupEventsResponse = TaskGroupAPI.TaskGroupStatusEvent | TaskRunAPI.TaskRunEvent | TaskRunAPI.ErrorEvent;
|
|
191
61
|
/**
|
|
192
62
|
* Event when a task run transitions to a non-active status.
|
|
193
63
|
*
|
|
194
64
|
* May indicate completion, cancellation, or failure.
|
|
195
65
|
*/
|
|
196
66
|
export type TaskGroupGetRunsResponse = TaskRunAPI.TaskRunEvent | TaskRunAPI.ErrorEvent;
|
|
67
|
+
export type TaskGroupStatus = TaskGroupAPI.TaskGroupStatus;
|
|
68
|
+
export type TaskGroupStatusEvent = TaskGroupAPI.TaskGroupStatusEvent;
|
|
69
|
+
export type TaskGroupRunResponse = TaskGroupAPI.TaskGroupRunResponse;
|
|
197
70
|
export interface TaskGroupCreateParams {
|
|
198
71
|
/**
|
|
199
72
|
* User-provided metadata stored with the task group.
|
|
@@ -238,6 +111,12 @@ export interface TaskGroupGetRunsParams {
|
|
|
238
111
|
status?: 'queued' | 'action_required' | 'running' | 'completed' | 'failed' | 'cancelling' | 'cancelled' | null;
|
|
239
112
|
}
|
|
240
113
|
export declare namespace TaskGroup {
|
|
241
|
-
export { type
|
|
114
|
+
export { type TaskGroupEventsResponse as TaskGroupEventsResponse, type TaskGroupGetRunsResponse as TaskGroupGetRunsResponse, type TaskGroupStatus as TaskGroupStatus, type TaskGroupStatusEvent as TaskGroupStatusEvent, type TaskGroupRunResponse as TaskGroupRunResponse, type TaskGroupCreateParams as TaskGroupCreateParams, type TaskGroupAddRunsParams as TaskGroupAddRunsParams, type TaskGroupEventsParams as TaskGroupEventsParams, type TaskGroupGetRunsParams as TaskGroupGetRunsParams, };
|
|
115
|
+
}
|
|
116
|
+
type _TaskGroupStatusEvent = TaskGroupStatusEvent;
|
|
117
|
+
export declare namespace TaskGroupEventsResponse {
|
|
118
|
+
/** @deprecated Use `Beta.TaskGroupStatusEvent` instead. */
|
|
119
|
+
type TaskGroupStatusEvent = _TaskGroupStatusEvent;
|
|
242
120
|
}
|
|
121
|
+
export {};
|
|
243
122
|
//# sourceMappingURL=task-group.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task-group.d.ts","sourceRoot":"","sources":["../../src/resources/beta/task-group.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,YAAY;OACjB,KAAK,UAAU;OACf,KAAK,cAAc;OACnB,EAAE,UAAU,EAAE;OACd,EAAE,MAAM,EAAE;OAEV,EAAE,cAAc,EAAE;AAGzB
|
|
1
|
+
{"version":3,"file":"task-group.d.ts","sourceRoot":"","sources":["../../src/resources/beta/task-group.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,YAAY;OACjB,KAAK,UAAU;OACf,KAAK,cAAc;OACnB,EAAE,UAAU,EAAE;OACd,EAAE,MAAM,EAAE;OAEV,EAAE,cAAc,EAAE;AAGzB;;;;GAIG;AACH,qBAAa,SAAU,SAAQ,WAAW;IACxC;;;;OAIG;IACH,MAAM,CAAC,IAAI,EAAE,qBAAqB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,YAAY,CAAC,SAAS,CAAC;IAQjG;;;;OAIG;IACH,QAAQ,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,YAAY,CAAC,SAAS,CAAC;IAO3F;;;;OAIG;IACH,OAAO,CACL,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,sBAAsB,EAC9B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,YAAY,CAAC,oBAAoB,CAAC;IAahD;;;;;;;OAOG;IACH,MAAM,CACJ,WAAW,EAAE,MAAM,EACnB,KAAK,GAAE,qBAAqB,GAAG,SAAc,EAC7C,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,MAAM,CAAC,uBA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sB;IACrC,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB,aAAa,CAAC,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,CAAC,OAAO,WAAW,SAAS,CAAC;IACjC,OAAO,EACL,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,eAAe,IAAI,eAAe,EACvC,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,sBAAsB,IAAI,sBAAsB,GACtD,CAAC;CACH;AAKD,KAAK,qBAAqB,GAAG,oBAAoB,CAAC;AAClD,yBAAiB,uBAAuB,CAAC;IACvC,2DAA2D;IAC3D,KAAY,oBAAoB,GAAG,qBAAqB,CAAC;CAC1D"}
|
|
@@ -6,24 +6,15 @@ const resource_1 = require("../../core/resource.js");
|
|
|
6
6
|
const headers_1 = require("../../internal/headers.js");
|
|
7
7
|
const path_1 = require("../../internal/utils/path.js");
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
10
|
-
* - Output metadata: citations, excerpts, reasoning, and confidence per field
|
|
9
|
+
* Tasks (Beta)
|
|
11
10
|
*
|
|
12
|
-
*
|
|
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
|
|
11
|
+
* @deprecated Use GA Task Group instead
|
|
18
12
|
*/
|
|
19
13
|
class TaskGroup extends resource_1.APIResource {
|
|
20
14
|
/**
|
|
21
15
|
* Initiates a TaskGroup to group and track multiple runs.
|
|
22
16
|
*
|
|
23
|
-
* @
|
|
24
|
-
* ```ts
|
|
25
|
-
* const taskGroup = await client.beta.taskGroup.create();
|
|
26
|
-
* ```
|
|
17
|
+
* @deprecated Use GA Task Group instead
|
|
27
18
|
*/
|
|
28
19
|
create(body, options) {
|
|
29
20
|
return this._client.post('/v1beta/tasks/groups', {
|
|
@@ -35,12 +26,7 @@ class TaskGroup extends resource_1.APIResource {
|
|
|
35
26
|
/**
|
|
36
27
|
* Retrieves aggregated status across runs in a TaskGroup.
|
|
37
28
|
*
|
|
38
|
-
* @
|
|
39
|
-
* ```ts
|
|
40
|
-
* const taskGroup = await client.beta.taskGroup.retrieve(
|
|
41
|
-
* 'taskgroup_id',
|
|
42
|
-
* );
|
|
43
|
-
* ```
|
|
29
|
+
* @deprecated Use GA Task Group instead
|
|
44
30
|
*/
|
|
45
31
|
retrieve(taskGroupID, options) {
|
|
46
32
|
return this._client.get((0, path_1.path) `/v1beta/tasks/groups/${taskGroupID}`, {
|
|
@@ -51,18 +37,7 @@ class TaskGroup extends resource_1.APIResource {
|
|
|
51
37
|
/**
|
|
52
38
|
* Initiates multiple task runs within a TaskGroup.
|
|
53
39
|
*
|
|
54
|
-
* @
|
|
55
|
-
* ```ts
|
|
56
|
-
* const taskGroupRunResponse =
|
|
57
|
-
* await client.beta.taskGroup.addRuns('taskgroup_id', {
|
|
58
|
-
* inputs: [
|
|
59
|
-
* {
|
|
60
|
-
* input: 'What was the GDP of France in 2023?',
|
|
61
|
-
* processor: 'base',
|
|
62
|
-
* },
|
|
63
|
-
* ],
|
|
64
|
-
* });
|
|
65
|
-
* ```
|
|
40
|
+
* @deprecated Use GA Task Group instead
|
|
66
41
|
*/
|
|
67
42
|
addRuns(taskGroupID, params, options) {
|
|
68
43
|
const { refresh_status, betas, ...body } = params;
|
|
@@ -82,12 +57,7 @@ class TaskGroup extends resource_1.APIResource {
|
|
|
82
57
|
* The connection will remain open for up to an hour as long as at least one run in
|
|
83
58
|
* the group is still active.
|
|
84
59
|
*
|
|
85
|
-
* @
|
|
86
|
-
* ```ts
|
|
87
|
-
* const response = await client.beta.taskGroup.events(
|
|
88
|
-
* 'taskgroup_id',
|
|
89
|
-
* );
|
|
90
|
-
* ```
|
|
60
|
+
* @deprecated Use GA Task Group instead
|
|
91
61
|
*/
|
|
92
62
|
events(taskGroupID, query = {}, options) {
|
|
93
63
|
return this._client.get((0, path_1.path) `/v1beta/tasks/groups/${taskGroupID}/events`, {
|
|
@@ -112,12 +82,7 @@ class TaskGroup extends resource_1.APIResource {
|
|
|
112
82
|
* the stream. The stream will resume from the next event after the
|
|
113
83
|
* `last_event_id`.
|
|
114
84
|
*
|
|
115
|
-
* @
|
|
116
|
-
* ```ts
|
|
117
|
-
* const response = await client.beta.taskGroup.getRuns(
|
|
118
|
-
* 'taskgroup_id',
|
|
119
|
-
* );
|
|
120
|
-
* ```
|
|
85
|
+
* @deprecated Use GA Task Group instead
|
|
121
86
|
*/
|
|
122
87
|
getRuns(taskGroupID, query = {}, options) {
|
|
123
88
|
return this._client.get((0, path_1.path) `/v1beta/tasks/groups/${taskGroupID}/runs`, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task-group.js","sourceRoot":"","sources":["../../src/resources/beta/task-group.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAMlD,uDAAsD;AAEtD,uDAAiD;AAEjD
|
|
1
|
+
{"version":3,"file":"task-group.js","sourceRoot":"","sources":["../../src/resources/beta/task-group.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAMlD,uDAAsD;AAEtD,uDAAiD;AAEjD;;;;GAIG;AACH,MAAa,SAAU,SAAQ,sBAAW;IACxC;;;;OAIG;IACH,MAAM,CAAC,IAA2B,EAAE,OAAwB;QAC1D,OAAO,IAAI,CA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;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC;gBACpB,EAAE,eAAe,EAAE,2BAA2B,EAAE,MAAM,EAAE,mBAAmB,EAAE;gBAC7E,OAAO,EAAE,OAAO;aACjB,CAAC;YACF,MAAM,EAAE,IAAI;SACb,CAAgD,CAAC;IACpD,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,OAAO,CACL,WAAmB,EACnB,QAA4C,EAAE,EAC9C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,wBAAwB,WAAW,OAAO,EAAE;YACtE,KAAK;YACL,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC;gBACpB,EAAE,eAAe,EAAE,2BAA2B,EAAE,MAAM,EAAE,mBAAmB,EAAE;gBAC7E,OAAO,EAAE,OAAO;aACjB,CAAC;YACF,MAAM,EAAE,IAAI;SACb,CAAiD,CAAC;IACrD,CAAC;CACF;AArGD,8BAqGC"}
|
|
@@ -3,24 +3,15 @@ import { APIResource } from "../../core/resource.mjs";
|
|
|
3
3
|
import { buildHeaders } from "../../internal/headers.mjs";
|
|
4
4
|
import { path } from "../../internal/utils/path.mjs";
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
* - Output metadata: citations, excerpts, reasoning, and confidence per field
|
|
6
|
+
* Tasks (Beta)
|
|
8
7
|
*
|
|
9
|
-
*
|
|
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
|
|
8
|
+
* @deprecated Use GA Task Group instead
|
|
15
9
|
*/
|
|
16
10
|
export class TaskGroup extends APIResource {
|
|
17
11
|
/**
|
|
18
12
|
* Initiates a TaskGroup to group and track multiple runs.
|
|
19
13
|
*
|
|
20
|
-
* @
|
|
21
|
-
* ```ts
|
|
22
|
-
* const taskGroup = await client.beta.taskGroup.create();
|
|
23
|
-
* ```
|
|
14
|
+
* @deprecated Use GA Task Group instead
|
|
24
15
|
*/
|
|
25
16
|
create(body, options) {
|
|
26
17
|
return this._client.post('/v1beta/tasks/groups', {
|
|
@@ -32,12 +23,7 @@ export class TaskGroup extends APIResource {
|
|
|
32
23
|
/**
|
|
33
24
|
* Retrieves aggregated status across runs in a TaskGroup.
|
|
34
25
|
*
|
|
35
|
-
* @
|
|
36
|
-
* ```ts
|
|
37
|
-
* const taskGroup = await client.beta.taskGroup.retrieve(
|
|
38
|
-
* 'taskgroup_id',
|
|
39
|
-
* );
|
|
40
|
-
* ```
|
|
26
|
+
* @deprecated Use GA Task Group instead
|
|
41
27
|
*/
|
|
42
28
|
retrieve(taskGroupID, options) {
|
|
43
29
|
return this._client.get(path `/v1beta/tasks/groups/${taskGroupID}`, {
|
|
@@ -48,18 +34,7 @@ export class TaskGroup extends APIResource {
|
|
|
48
34
|
/**
|
|
49
35
|
* Initiates multiple task runs within a TaskGroup.
|
|
50
36
|
*
|
|
51
|
-
* @
|
|
52
|
-
* ```ts
|
|
53
|
-
* const taskGroupRunResponse =
|
|
54
|
-
* await client.beta.taskGroup.addRuns('taskgroup_id', {
|
|
55
|
-
* inputs: [
|
|
56
|
-
* {
|
|
57
|
-
* input: 'What was the GDP of France in 2023?',
|
|
58
|
-
* processor: 'base',
|
|
59
|
-
* },
|
|
60
|
-
* ],
|
|
61
|
-
* });
|
|
62
|
-
* ```
|
|
37
|
+
* @deprecated Use GA Task Group instead
|
|
63
38
|
*/
|
|
64
39
|
addRuns(taskGroupID, params, options) {
|
|
65
40
|
const { refresh_status, betas, ...body } = params;
|
|
@@ -79,12 +54,7 @@ export class TaskGroup extends APIResource {
|
|
|
79
54
|
* The connection will remain open for up to an hour as long as at least one run in
|
|
80
55
|
* the group is still active.
|
|
81
56
|
*
|
|
82
|
-
* @
|
|
83
|
-
* ```ts
|
|
84
|
-
* const response = await client.beta.taskGroup.events(
|
|
85
|
-
* 'taskgroup_id',
|
|
86
|
-
* );
|
|
87
|
-
* ```
|
|
57
|
+
* @deprecated Use GA Task Group instead
|
|
88
58
|
*/
|
|
89
59
|
events(taskGroupID, query = {}, options) {
|
|
90
60
|
return this._client.get(path `/v1beta/tasks/groups/${taskGroupID}/events`, {
|
|
@@ -109,12 +79,7 @@ export class TaskGroup extends APIResource {
|
|
|
109
79
|
* the stream. The stream will resume from the next event after the
|
|
110
80
|
* `last_event_id`.
|
|
111
81
|
*
|
|
112
|
-
* @
|
|
113
|
-
* ```ts
|
|
114
|
-
* const response = await client.beta.taskGroup.getRuns(
|
|
115
|
-
* 'taskgroup_id',
|
|
116
|
-
* );
|
|
117
|
-
* ```
|
|
82
|
+
* @deprecated Use GA Task Group instead
|
|
118
83
|
*/
|
|
119
84
|
getRuns(taskGroupID, query = {}, options) {
|
|
120
85
|
return this._client.get(path `/v1beta/tasks/groups/${taskGroupID}/runs`, {
|