openpond-sdk 0.9.0 → 0.9.1
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/README.md +17 -0
- package/dist/{chunk-KIBRMKJQ.js → chunk-JCPLAIZL.js} +284 -227
- package/dist/chunk-JCPLAIZL.js.map +7 -0
- package/dist/dataset-workspaces.js +1 -1
- package/dist/model-starter-catalog.js +1 -1
- package/dist/model-starters.js +1 -1
- package/dist/taskset-drafts.js +1 -1
- package/dist/taskset-packages.js +1 -1
- package/dist/training-bundle.js +1 -1
- package/dist/training.js +9 -1
- package/dist/types/packages/sdk/src/model-starter-attempts.d.ts +8 -8
- package/dist/types/packages/sdk/src/model-taskset-runs-contracts.d.ts +4 -4
- package/dist/types/packages/sdk/src/model-taskset-runs.d.ts +5 -5
- package/dist/types/packages/sdk/src/training-acceptance.d.ts +234 -0
- package/dist/types/packages/sdk/src/training-acceptance.d.ts.map +1 -0
- package/dist/types/packages/sdk/src/training.d.ts +156 -11
- package/dist/types/packages/sdk/src/training.d.ts.map +1 -1
- package/package.json +2 -2
- package/dist/chunk-KIBRMKJQ.js.map +0 -7
|
@@ -19,59 +19,111 @@ import {
|
|
|
19
19
|
ImmutableReleaseRefSchema
|
|
20
20
|
} from "./chunk-QUOW6URQ.js";
|
|
21
21
|
|
|
22
|
+
// src/training-acceptance.ts
|
|
23
|
+
import { z } from "zod";
|
|
24
|
+
import { assertAcceptanceGroupSnapshot, AcceptanceGroupSnapshotSchema } from "@openpond/evals/learning";
|
|
25
|
+
var Id = z.string().trim().min(1).max(240);
|
|
26
|
+
var TrainingAcceptanceGroupReferenceSchema = ModelProjectImmutableRefSchema.extend({ revision: z.number().int().positive() }).strict();
|
|
27
|
+
var TrainingAcceptanceGroupSummarySchema = TrainingAcceptanceGroupReferenceSchema.extend({
|
|
28
|
+
teamId: Id,
|
|
29
|
+
jobId: Id,
|
|
30
|
+
plan: ModelProjectImmutableRefSchema,
|
|
31
|
+
baseline: ModelProjectImmutableRefSchema,
|
|
32
|
+
candidate: ModelProjectImmutableRefSchema,
|
|
33
|
+
state: AcceptanceGroupSnapshotSchema.shape.state,
|
|
34
|
+
updatedAt: z.string().datetime()
|
|
35
|
+
}).strict();
|
|
36
|
+
var TrainingAcceptanceGroupPageSchema = z.object({
|
|
37
|
+
schemaVersion: z.literal("openpond.trainingAcceptanceGroupPage.v1"),
|
|
38
|
+
teamId: Id,
|
|
39
|
+
jobId: Id,
|
|
40
|
+
groups: z.array(TrainingAcceptanceGroupSummarySchema).max(100),
|
|
41
|
+
nextCursor: Id.nullable()
|
|
42
|
+
}).strict();
|
|
43
|
+
var TrainingAcceptanceGroupQuerySchema = z.object({
|
|
44
|
+
cursor: Id.optional(),
|
|
45
|
+
limit: z.number().int().min(1).max(100).default(25)
|
|
46
|
+
}).strict();
|
|
47
|
+
function createTrainingAcceptanceClient(request) {
|
|
48
|
+
const route = (target) => {
|
|
49
|
+
Id.parse(target.teamId);
|
|
50
|
+
return `/v1/training/jobs/${encodeURIComponent(Id.parse(target.jobId))}/acceptance-groups`;
|
|
51
|
+
};
|
|
52
|
+
return {
|
|
53
|
+
async acceptanceGroups(target, input = {}) {
|
|
54
|
+
const query = TrainingAcceptanceGroupQuerySchema.parse(input);
|
|
55
|
+
const params = new URLSearchParams({ limit: String(query.limit) });
|
|
56
|
+
if (query.cursor) params.set("cursor", query.cursor);
|
|
57
|
+
const page = TrainingAcceptanceGroupPageSchema.parse(await request(`${route(target)}?${params}`));
|
|
58
|
+
if (page.teamId !== target.teamId || page.jobId !== target.jobId || page.groups.length > query.limit || page.groups.some((group) => group.teamId !== target.teamId || group.jobId !== target.jobId || query.cursor && group.id <= query.cursor) || new Set(page.groups.map((group) => group.id)).size !== page.groups.length || page.nextCursor !== null && page.nextCursor !== page.groups.at(-1)?.id)
|
|
59
|
+
throw new OpenPondProtocolError("acceptance_group_scope_mismatch", "Acceptance groups do not match the requested workspace, job or cursor.");
|
|
60
|
+
return page;
|
|
61
|
+
},
|
|
62
|
+
async acceptanceGroup(target, groupId, expected) {
|
|
63
|
+
const reference = expected ? TrainingAcceptanceGroupReferenceSchema.parse({ id: expected.id, revision: expected.revision, contentHash: expected.contentHash }) : null;
|
|
64
|
+
if (reference && reference.id !== groupId) throw new OpenPondProtocolError("acceptance_group_identity_mismatch", "The retained group reference differs from the requested group.");
|
|
65
|
+
const suffix = reference ? `?revision=${reference.revision}` : "";
|
|
66
|
+
const snapshot = assertAcceptanceGroupSnapshot(await request(`${route(target)}/${encodeURIComponent(Id.parse(groupId))}${suffix}`));
|
|
67
|
+
if (snapshot.manifest.teamId !== target.teamId || snapshot.manifest.trainingJob.id !== target.jobId || snapshot.manifest.id !== groupId || reference && (snapshot.revision !== reference.revision || snapshot.contentHash !== reference.contentHash))
|
|
68
|
+
throw new OpenPondProtocolError("acceptance_group_identity_mismatch", "Acceptance evidence does not match the requested workspace, job or retained revision.");
|
|
69
|
+
return snapshot;
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
|
|
22
74
|
// src/training.ts
|
|
23
|
-
import { z as
|
|
75
|
+
import { z as z8 } from "zod";
|
|
24
76
|
|
|
25
77
|
// src/training-preparations.ts
|
|
26
|
-
import { z } from "zod";
|
|
27
|
-
var
|
|
28
|
-
var Hash =
|
|
29
|
-
var TrainingPreparationRequestSchema =
|
|
30
|
-
schemaVersion:
|
|
31
|
-
teamId:
|
|
32
|
-
operationId:
|
|
33
|
-
projectId:
|
|
34
|
-
configuration:
|
|
78
|
+
import { z as z2 } from "zod";
|
|
79
|
+
var Id2 = z2.string().trim().min(1).max(191);
|
|
80
|
+
var Hash = z2.string().regex(/^[a-f0-9]{64}$/);
|
|
81
|
+
var TrainingPreparationRequestSchema = z2.object({
|
|
82
|
+
schemaVersion: z2.literal("openpond.trainingPreparationRequest.v1"),
|
|
83
|
+
teamId: Id2,
|
|
84
|
+
operationId: Id2,
|
|
85
|
+
projectId: Id2.nullable(),
|
|
86
|
+
configuration: z2.object({ id: Id2, expectedRevision: z2.number().int().positive(), expectedEtag: Hash }).strict(),
|
|
35
87
|
batch: ModelProjectVersionedRefSchema,
|
|
36
|
-
name:
|
|
37
|
-
maximumSpendUsd:
|
|
88
|
+
name: z2.string().trim().min(1).max(191),
|
|
89
|
+
maximumSpendUsd: z2.number().finite().positive().max(1e6)
|
|
38
90
|
}).strict();
|
|
39
|
-
var TrainingPreparationPlanContentSchema =
|
|
40
|
-
schemaVersion:
|
|
41
|
-
id:
|
|
42
|
-
creatorUserId:
|
|
91
|
+
var TrainingPreparationPlanContentSchema = z2.object({
|
|
92
|
+
schemaVersion: z2.literal("openpond.trainingPreparationPlan.v1"),
|
|
93
|
+
id: Id2,
|
|
94
|
+
creatorUserId: Id2,
|
|
43
95
|
request: TrainingPreparationRequestSchema,
|
|
44
96
|
requestHash: Hash,
|
|
45
|
-
source:
|
|
97
|
+
source: z2.lazy(() => TrainingJobSourceSchema),
|
|
46
98
|
submissionHash: Hash,
|
|
47
|
-
createdAt:
|
|
99
|
+
createdAt: z2.string().datetime({ offset: true })
|
|
48
100
|
}).strict();
|
|
49
101
|
var TrainingPreparationPlanSchema = TrainingPreparationPlanContentSchema.extend({ contentHash: Hash }).strict();
|
|
50
|
-
var TrainingPreparationReceiptSchema =
|
|
51
|
-
schemaVersion:
|
|
102
|
+
var TrainingPreparationReceiptSchema = z2.object({
|
|
103
|
+
schemaVersion: z2.literal("openpond.trainingPreparationReceipt.v1"),
|
|
52
104
|
plan: TrainingPreparationPlanSchema,
|
|
53
|
-
revision:
|
|
54
|
-
state:
|
|
55
|
-
jobId:
|
|
105
|
+
revision: z2.number().int().positive(),
|
|
106
|
+
state: z2.enum(["prepared", "submitted", "cancelled"]),
|
|
107
|
+
jobId: Id2.nullable()
|
|
56
108
|
}).strict().superRefine((value, context) => {
|
|
57
109
|
if (value.state === "submitted" !== Boolean(value.jobId)) context.addIssue({ code: "custom", path: ["jobId"], message: "Only submitted preparations identify a job." });
|
|
58
110
|
});
|
|
59
|
-
var TrainingPreparationControlSchema =
|
|
60
|
-
teamId:
|
|
111
|
+
var TrainingPreparationControlSchema = z2.object({
|
|
112
|
+
teamId: Id2,
|
|
61
113
|
planHash: Hash,
|
|
62
|
-
expectedRevision:
|
|
114
|
+
expectedRevision: z2.number().int().positive()
|
|
63
115
|
}).strict();
|
|
64
|
-
var TrainingPreparationListQuerySchema =
|
|
65
|
-
projectId:
|
|
66
|
-
state:
|
|
67
|
-
afterId:
|
|
68
|
-
limit:
|
|
116
|
+
var TrainingPreparationListQuerySchema = z2.object({
|
|
117
|
+
projectId: Id2.optional(),
|
|
118
|
+
state: z2.enum(["prepared", "submitted", "cancelled"]).optional(),
|
|
119
|
+
afterId: Id2.optional(),
|
|
120
|
+
limit: z2.number().int().min(1).max(100).default(25)
|
|
69
121
|
}).strict();
|
|
70
|
-
var TrainingPreparationPageSchema =
|
|
71
|
-
schemaVersion:
|
|
72
|
-
teamId:
|
|
73
|
-
items:
|
|
74
|
-
nextCursor:
|
|
122
|
+
var TrainingPreparationPageSchema = z2.object({
|
|
123
|
+
schemaVersion: z2.literal("openpond.trainingPreparationPage.v1"),
|
|
124
|
+
teamId: Id2,
|
|
125
|
+
items: z2.array(TrainingPreparationReceiptSchema).max(100),
|
|
126
|
+
nextCursor: Id2.nullable()
|
|
75
127
|
}).strict();
|
|
76
128
|
async function parseAndVerifyTrainingPreparationReceipt(value) {
|
|
77
129
|
const receipt = TrainingPreparationReceiptSchema.parse(value);
|
|
@@ -91,7 +143,7 @@ function createTrainingPreparationClient(request) {
|
|
|
91
143
|
return {
|
|
92
144
|
/** Discover the authenticated user's retained preparations without creating jobs. */
|
|
93
145
|
async listPreparations(teamId, input = {}) {
|
|
94
|
-
const scope =
|
|
146
|
+
const scope = Id2.parse(teamId);
|
|
95
147
|
const query = TrainingPreparationListQuerySchema.parse(input);
|
|
96
148
|
const params = new URLSearchParams();
|
|
97
149
|
for (const [key, value] of Object.entries(query)) params.set(key, String(value));
|
|
@@ -116,18 +168,18 @@ function createTrainingPreparationClient(request) {
|
|
|
116
168
|
return receipt;
|
|
117
169
|
},
|
|
118
170
|
async getPreparation(teamId, id) {
|
|
119
|
-
return read(await request(`/v1/training/preparations/${encodeURIComponent(
|
|
171
|
+
return read(await request(`/v1/training/preparations/${encodeURIComponent(Id2.parse(id))}`), Id2.parse(teamId), id);
|
|
120
172
|
},
|
|
121
173
|
async startPreparation(id, input) {
|
|
122
174
|
const parsed = TrainingPreparationControlSchema.parse(input);
|
|
123
|
-
const receipt = await read(await request(`/v1/training/preparations/${encodeURIComponent(
|
|
175
|
+
const receipt = await read(await request(`/v1/training/preparations/${encodeURIComponent(Id2.parse(id))}/start`, { method: "POST", body: JSON.stringify(parsed) }), parsed.teamId, id);
|
|
124
176
|
if (receipt.plan.contentHash !== parsed.planHash || receipt.state !== "submitted")
|
|
125
177
|
throw new OpenPondProtocolError("training_preparation_start_mismatch", "The submitted run does not match the approved preparation.");
|
|
126
178
|
return receipt;
|
|
127
179
|
},
|
|
128
180
|
async cancelPreparation(id, input) {
|
|
129
181
|
const parsed = TrainingPreparationControlSchema.parse(input);
|
|
130
|
-
const receipt = await read(await request(`/v1/training/preparations/${encodeURIComponent(
|
|
182
|
+
const receipt = await read(await request(`/v1/training/preparations/${encodeURIComponent(Id2.parse(id))}/cancel`, { method: "POST", body: JSON.stringify(parsed) }), parsed.teamId, id);
|
|
131
183
|
if (receipt.plan.contentHash !== parsed.planHash || receipt.state !== "cancelled")
|
|
132
184
|
throw new OpenPondProtocolError("training_preparation_cancel_mismatch", "The preparation cancellation could not be verified.");
|
|
133
185
|
return receipt;
|
|
@@ -136,12 +188,12 @@ function createTrainingPreparationClient(request) {
|
|
|
136
188
|
}
|
|
137
189
|
|
|
138
190
|
// src/training-harness-sources.ts
|
|
139
|
-
import { z as
|
|
140
|
-
var TrainingHarnessSourcePublicationSchema =
|
|
141
|
-
schemaVersion:
|
|
191
|
+
import { z as z3 } from "zod";
|
|
192
|
+
var TrainingHarnessSourcePublicationSchema = z3.object({
|
|
193
|
+
schemaVersion: z3.literal("openpond.trainingHarnessSourcePublication.v1"),
|
|
142
194
|
harnessRelease: ImmutableReleaseRefSchema,
|
|
143
|
-
sourcePackageHash:
|
|
144
|
-
sizeBytes:
|
|
195
|
+
sourcePackageHash: z3.string().regex(/^[a-f0-9]{64}$/),
|
|
196
|
+
sizeBytes: z3.number().int().positive().max(TRAINING_INPUT_ARTIFACT_MAX_BYTES)
|
|
145
197
|
}).strict();
|
|
146
198
|
function createTrainingHarnessSourceClient(request) {
|
|
147
199
|
const route = (reference) => {
|
|
@@ -171,28 +223,28 @@ function createTrainingHarnessSourceClient(request) {
|
|
|
171
223
|
}
|
|
172
224
|
|
|
173
225
|
// src/training-candidate-decisions.ts
|
|
174
|
-
import { z as
|
|
175
|
-
var IdSchema = /* @__PURE__ */ (() =>
|
|
176
|
-
var HashSchema = /* @__PURE__ */ (() =>
|
|
177
|
-
var TrainingCandidateDecisionRequestSchema = /* @__PURE__ */ (() =>
|
|
178
|
-
schemaVersion:
|
|
226
|
+
import { z as z4 } from "zod";
|
|
227
|
+
var IdSchema = /* @__PURE__ */ (() => z4.string().trim().min(1).max(500))();
|
|
228
|
+
var HashSchema = /* @__PURE__ */ (() => z4.string().regex(/^[a-f0-9]{64}$/))();
|
|
229
|
+
var TrainingCandidateDecisionRequestSchema = /* @__PURE__ */ (() => z4.object({
|
|
230
|
+
schemaVersion: z4.literal("openpond.trainingCandidateDecisionRequest.v1"),
|
|
179
231
|
teamId: IdSchema,
|
|
180
232
|
jobId: IdSchema,
|
|
181
233
|
artifact: ModelProjectImmutableRefSchema,
|
|
182
234
|
evaluation: ModelProjectImmutableRefSchema,
|
|
183
235
|
executionReceipt: ModelProjectImmutableRefSchema,
|
|
184
|
-
decision:
|
|
185
|
-
reason:
|
|
236
|
+
decision: z4.enum(["accepted", "rejected"]),
|
|
237
|
+
reason: z4.string().trim().min(1).max(5e3),
|
|
186
238
|
idempotencyKey: IdSchema,
|
|
187
239
|
expectedDecision: ModelProjectImmutableRefSchema.nullable()
|
|
188
240
|
}).strict())();
|
|
189
|
-
var TrainingCandidateDecisionSchema = /* @__PURE__ */ (() =>
|
|
190
|
-
schemaVersion:
|
|
241
|
+
var TrainingCandidateDecisionSchema = /* @__PURE__ */ (() => z4.object({
|
|
242
|
+
schemaVersion: z4.literal("openpond.trainingCandidateDecision.v1"),
|
|
191
243
|
id: IdSchema,
|
|
192
244
|
request: TrainingCandidateDecisionRequestSchema,
|
|
193
|
-
revision:
|
|
194
|
-
actor:
|
|
195
|
-
decidedAt:
|
|
245
|
+
revision: z4.number().int().positive(),
|
|
246
|
+
actor: z4.object({ userId: IdSchema, kind: z4.enum(["user", "api_key", "agent_delegate"]), id: IdSchema }).strict(),
|
|
247
|
+
decidedAt: z4.string().datetime({ offset: true }),
|
|
196
248
|
contentHash: HashSchema
|
|
197
249
|
}).strict().superRefine((value, context) => {
|
|
198
250
|
if (value.revision === 1 !== (value.request.expectedDecision === null)) {
|
|
@@ -229,7 +281,7 @@ function createTrainingCandidateDecisionClient(request) {
|
|
|
229
281
|
IdSchema.parse(target.teamId);
|
|
230
282
|
const reference = options.decision ? ModelProjectImmutableRefSchema.parse(options.decision) : void 0;
|
|
231
283
|
const query = reference ? `?decisionId=${encodeURIComponent(reference.id)}` : "";
|
|
232
|
-
const response =
|
|
284
|
+
const response = z4.object({ decision: z4.unknown().nullable() }).strict().parse(await request(`${route(target)}${query}`));
|
|
233
285
|
if (response.decision === null && !reference) return null;
|
|
234
286
|
const decision = await parseAndVerifyTrainingCandidateDecision(response.decision, target);
|
|
235
287
|
if (reference && (decision.id !== reference.id || decision.contentHash !== reference.contentHash)) {
|
|
@@ -246,38 +298,38 @@ function createTrainingCandidateDecisionClient(request) {
|
|
|
246
298
|
}
|
|
247
299
|
|
|
248
300
|
// src/training-evaluation-results.ts
|
|
249
|
-
import { z as
|
|
250
|
-
var IdSchema2 = /* @__PURE__ */ (() =>
|
|
251
|
-
var HashSchema2 = /* @__PURE__ */ (() =>
|
|
252
|
-
var TrainingEvaluationTaskResultSchema = /* @__PURE__ */ (() =>
|
|
301
|
+
import { z as z5 } from "zod";
|
|
302
|
+
var IdSchema2 = /* @__PURE__ */ (() => z5.string().trim().min(1).max(500))();
|
|
303
|
+
var HashSchema2 = /* @__PURE__ */ (() => z5.string().regex(/^[a-f0-9]{64}$/))();
|
|
304
|
+
var TrainingEvaluationTaskResultSchema = /* @__PURE__ */ (() => z5.object({
|
|
253
305
|
taskId: IdSchema2,
|
|
254
306
|
taskSha256: HashSchema2,
|
|
255
307
|
resultSha256: HashSchema2,
|
|
256
|
-
input:
|
|
257
|
-
instruction:
|
|
258
|
-
context:
|
|
308
|
+
input: z5.object({
|
|
309
|
+
instruction: z5.string().max(1e6),
|
|
310
|
+
context: z5.record(z5.string(), z5.unknown())
|
|
259
311
|
}).strict(),
|
|
260
|
-
output:
|
|
312
|
+
output: z5.string().max(1e6),
|
|
261
313
|
outputSha256: HashSchema2,
|
|
262
|
-
score:
|
|
263
|
-
evidence:
|
|
264
|
-
kind:
|
|
314
|
+
score: z5.number().finite().min(0).max(1),
|
|
315
|
+
evidence: z5.object({
|
|
316
|
+
kind: z5.enum(["worker_command", "hosted_trace", "local_trace"]),
|
|
265
317
|
id: IdSchema2
|
|
266
318
|
}).strict()
|
|
267
319
|
}).strict())();
|
|
268
|
-
var TrainingEvaluationTaskPageSchema = /* @__PURE__ */ (() =>
|
|
269
|
-
schemaVersion:
|
|
320
|
+
var TrainingEvaluationTaskPageSchema = /* @__PURE__ */ (() => z5.object({
|
|
321
|
+
schemaVersion: z5.literal("openpond.trainingEvaluationTaskPage.v1"),
|
|
270
322
|
jobId: IdSchema2,
|
|
271
323
|
teamId: IdSchema2,
|
|
272
324
|
evaluation: ModelProjectImmutableRefSchema,
|
|
273
|
-
kind:
|
|
274
|
-
policyVersion:
|
|
325
|
+
kind: z5.enum(["baseline", "candidate"]),
|
|
326
|
+
policyVersion: z5.number().int().nonnegative(),
|
|
275
327
|
taskset: ModelProjectVersionedRefSchema,
|
|
276
328
|
panelSha256: HashSchema2,
|
|
277
|
-
offset:
|
|
278
|
-
total:
|
|
279
|
-
tasks:
|
|
280
|
-
nextCursor:
|
|
329
|
+
offset: z5.number().int().nonnegative(),
|
|
330
|
+
total: z5.number().int().min(1).max(1e4),
|
|
331
|
+
tasks: z5.array(TrainingEvaluationTaskResultSchema).min(1).max(100),
|
|
332
|
+
nextCursor: z5.string().regex(/^[1-9]\d*$/).nullable(),
|
|
281
333
|
contentHash: HashSchema2
|
|
282
334
|
}).strict().superRefine((page, context) => {
|
|
283
335
|
const end = page.offset + page.tasks.length;
|
|
@@ -312,12 +364,12 @@ async function parseAndVerifyTrainingEvaluationTaskPage(value, expected) {
|
|
|
312
364
|
}
|
|
313
365
|
|
|
314
366
|
// src/training-grading-plan.ts
|
|
315
|
-
import { z as
|
|
367
|
+
import { z as z6 } from "zod";
|
|
316
368
|
import { compileBoundGraders, RewardBindingSchema, RewardReleaseSchema } from "@openpond/evals/rewards";
|
|
317
|
-
var GradersSchema =
|
|
318
|
-
var RewardExecutionSchema =
|
|
369
|
+
var GradersSchema = z6.array(z6.object({ id: z6.string().trim().min(1) }).catchall(z6.unknown())).min(1).max(1e3);
|
|
370
|
+
var RewardExecutionSchema = z6.object({
|
|
319
371
|
binding: RewardBindingSchema,
|
|
320
|
-
rewards:
|
|
372
|
+
rewards: z6.array(RewardReleaseSchema).min(1).max(100)
|
|
321
373
|
}).strict();
|
|
322
374
|
async function deterministicTrainingRewardSource(input) {
|
|
323
375
|
const execution = input.rewardExecution ? RewardExecutionSchema.parse(input.rewardExecution) : null;
|
|
@@ -334,23 +386,23 @@ async function deterministicTrainingRewardSource(input) {
|
|
|
334
386
|
}
|
|
335
387
|
|
|
336
388
|
// src/training-evaluation-source.ts
|
|
337
|
-
import { z as
|
|
389
|
+
import { z as z7 } from "zod";
|
|
338
390
|
var TRAINING_EVALUATION_SOURCE_PATH = "evaluation-source.json";
|
|
339
|
-
var TaskIdentitySchema =
|
|
340
|
-
id:
|
|
341
|
-
clusterKey:
|
|
342
|
-
split:
|
|
391
|
+
var TaskIdentitySchema = z7.object({
|
|
392
|
+
id: z7.string().trim().min(1),
|
|
393
|
+
clusterKey: z7.string().trim().min(1),
|
|
394
|
+
split: z7.enum(["train", "validation", "frozen_eval"])
|
|
343
395
|
}).passthrough();
|
|
344
|
-
var TrainingEvaluationSourceSchema =
|
|
345
|
-
schemaVersion:
|
|
396
|
+
var TrainingEvaluationSourceSchema = z7.object({
|
|
397
|
+
schemaVersion: z7.literal("openpond.trainingEvaluationSource.v1"),
|
|
346
398
|
taskset: ModelProjectVersionedRefSchema,
|
|
347
|
-
tasks:
|
|
348
|
-
assets:
|
|
349
|
-
path:
|
|
350
|
-
sha256:
|
|
351
|
-
sizeBytes:
|
|
352
|
-
encoding:
|
|
353
|
-
content:
|
|
399
|
+
tasks: z7.array(TaskIdentitySchema).min(1).max(1e4),
|
|
400
|
+
assets: z7.array(z7.object({
|
|
401
|
+
path: z7.string().trim().min(1).max(2e3),
|
|
402
|
+
sha256: z7.string().regex(/^[a-f0-9]{64}$/),
|
|
403
|
+
sizeBytes: z7.number().int().nonnegative(),
|
|
404
|
+
encoding: z7.literal("base64"),
|
|
405
|
+
content: z7.string().max(32 * 1024 * 1024)
|
|
354
406
|
}).strict()).max(1e4)
|
|
355
407
|
}).strict().superRefine((source, context) => {
|
|
356
408
|
const ids = /* @__PURE__ */ new Set();
|
|
@@ -361,8 +413,8 @@ var TrainingEvaluationSourceSchema = z6.object({
|
|
|
361
413
|
});
|
|
362
414
|
});
|
|
363
415
|
function assertTrainingEvaluationIsolation(trainingTasks, evaluationTasks) {
|
|
364
|
-
const training =
|
|
365
|
-
const evaluation =
|
|
416
|
+
const training = z7.array(TaskIdentitySchema).min(1).max(1e4).parse(trainingTasks);
|
|
417
|
+
const evaluation = z7.array(TaskIdentitySchema).min(1).max(1e4).parse(evaluationTasks);
|
|
366
418
|
const trainIds = /* @__PURE__ */ new Set();
|
|
367
419
|
const trainFamilies = /* @__PURE__ */ new Set();
|
|
368
420
|
for (const task of training) {
|
|
@@ -388,24 +440,24 @@ async function trainingEvaluationSourceRef(input) {
|
|
|
388
440
|
}
|
|
389
441
|
|
|
390
442
|
// src/training.ts
|
|
391
|
-
var IdSchema3 =
|
|
392
|
-
var HashSchema3 =
|
|
393
|
-
var TimestampSchema =
|
|
394
|
-
var TrainingInputArtifactUploadSchema =
|
|
395
|
-
schemaVersion:
|
|
396
|
-
kind:
|
|
397
|
-
idempotencyKey:
|
|
443
|
+
var IdSchema3 = z8.string().trim().min(1).max(500);
|
|
444
|
+
var HashSchema3 = z8.string().regex(/^[a-f0-9]{64}$/);
|
|
445
|
+
var TimestampSchema = z8.string().datetime({ offset: true });
|
|
446
|
+
var TrainingInputArtifactUploadSchema = z8.object({
|
|
447
|
+
schemaVersion: z8.literal("openpond.trainingInputArtifactUpload.v2"),
|
|
448
|
+
kind: z8.enum(["portable_training_bundle", "reward_model_dataset"]),
|
|
449
|
+
idempotencyKey: z8.string().trim().min(1).max(500),
|
|
398
450
|
sourceManifest: ModelProjectImmutableRefSchema,
|
|
399
|
-
payload:
|
|
451
|
+
payload: z8.unknown(),
|
|
400
452
|
contentHash: HashSchema3
|
|
401
453
|
}).strict();
|
|
402
|
-
var TrainingInputArtifactSchema =
|
|
403
|
-
schemaVersion:
|
|
404
|
-
kind:
|
|
454
|
+
var TrainingInputArtifactSchema = z8.object({
|
|
455
|
+
schemaVersion: z8.literal("openpond.trainingInputArtifact.v2"),
|
|
456
|
+
kind: z8.enum(["portable_training_bundle", "reward_model_dataset"]),
|
|
405
457
|
sourceManifest: ModelProjectImmutableRefSchema,
|
|
406
|
-
artifactRef:
|
|
458
|
+
artifactRef: z8.string().trim().min(1).max(2e3),
|
|
407
459
|
contentHash: HashSchema3,
|
|
408
|
-
sizeBytes:
|
|
460
|
+
sizeBytes: z8.number().int().positive(),
|
|
409
461
|
createdAt: TimestampSchema
|
|
410
462
|
}).strict();
|
|
411
463
|
async function trainingInputArtifactUploadHash(upload) {
|
|
@@ -428,11 +480,11 @@ async function parseAndVerifyTrainingInputArtifactUpload(value) {
|
|
|
428
480
|
}
|
|
429
481
|
return parsed;
|
|
430
482
|
}
|
|
431
|
-
var TrainingJobKindSchema =
|
|
483
|
+
var TrainingJobKindSchema = z8.enum([
|
|
432
484
|
"reward_model_train",
|
|
433
485
|
"policy_optimize"
|
|
434
486
|
]);
|
|
435
|
-
var TrainingJobStateSchema =
|
|
487
|
+
var TrainingJobStateSchema = z8.enum([
|
|
436
488
|
"queued",
|
|
437
489
|
"admitting",
|
|
438
490
|
"provisioning",
|
|
@@ -443,91 +495,91 @@ var TrainingJobStateSchema = z7.enum([
|
|
|
443
495
|
"failed",
|
|
444
496
|
"cancelled"
|
|
445
497
|
]);
|
|
446
|
-
var TrainingCapabilityRequirementSchema =
|
|
498
|
+
var TrainingCapabilityRequirementSchema = z8.object({
|
|
447
499
|
id: IdSchema3,
|
|
448
|
-
version:
|
|
449
|
-
required:
|
|
500
|
+
version: z8.string().trim().min(1).max(200).nullable().default(null),
|
|
501
|
+
required: z8.boolean().default(true)
|
|
450
502
|
}).strict();
|
|
451
|
-
var TrainingJobSourceSchema =
|
|
452
|
-
modelProject:
|
|
503
|
+
var TrainingJobSourceSchema = z8.object({
|
|
504
|
+
modelProject: z8.object({
|
|
453
505
|
id: IdSchema3,
|
|
454
506
|
portableProjectId: IdSchema3,
|
|
455
|
-
revision:
|
|
507
|
+
revision: z8.number().int().positive(),
|
|
456
508
|
contentHash: HashSchema3
|
|
457
509
|
}).strict(),
|
|
458
510
|
harnessRunManifest: ModelProjectImmutableRefSchema,
|
|
459
511
|
harnessRelease: ModelProjectImmutableRefSchema,
|
|
460
512
|
taskset: ModelProjectVersionedRefSchema,
|
|
461
513
|
tasksetRelease: ModelProjectImmutableRefSchema,
|
|
462
|
-
evaluation:
|
|
514
|
+
evaluation: z8.object({
|
|
463
515
|
taskset: ModelProjectVersionedRefSchema,
|
|
464
516
|
dataset: ModelProjectImmutableRefSchema
|
|
465
517
|
}).strict().nullable().optional(),
|
|
466
518
|
dataset: ModelProjectImmutableRefSchema,
|
|
467
|
-
evidenceSets:
|
|
519
|
+
evidenceSets: z8.array(ModelProjectImmutableRefSchema).max(1e4)
|
|
468
520
|
}).strict();
|
|
469
|
-
var RewardModelTrainingRequestSchema =
|
|
470
|
-
kind:
|
|
521
|
+
var RewardModelTrainingRequestSchema = z8.object({
|
|
522
|
+
kind: z8.literal("reward_model_train"),
|
|
471
523
|
baseModel: ModelProjectBaseModelSchema,
|
|
472
524
|
preferenceDatasetRelease: ModelProjectImmutableRefSchema,
|
|
473
525
|
processorRelease: ModelProjectImmutableRefSchema,
|
|
474
|
-
recipe:
|
|
475
|
-
schemaVersion:
|
|
476
|
-
method:
|
|
477
|
-
parameterization:
|
|
478
|
-
}).catchall(
|
|
526
|
+
recipe: z8.object({
|
|
527
|
+
schemaVersion: z8.literal("openpond.rewardModelRecipe.v1"),
|
|
528
|
+
method: z8.literal("reward_model"),
|
|
529
|
+
parameterization: z8.literal("lora_with_scalar_head")
|
|
530
|
+
}).catchall(z8.unknown())
|
|
479
531
|
}).strict();
|
|
480
|
-
var DeterministicRewardSourceSchema =
|
|
481
|
-
kind:
|
|
532
|
+
var DeterministicRewardSourceSchema = z8.object({
|
|
533
|
+
kind: z8.literal("deterministic"),
|
|
482
534
|
grader: ModelProjectImmutableRefSchema,
|
|
483
535
|
composer: ModelProjectImmutableRefSchema.nullable().default(null)
|
|
484
536
|
}).strict();
|
|
485
|
-
var LearnedRewardSourceSchema =
|
|
486
|
-
kind:
|
|
537
|
+
var LearnedRewardSourceSchema = z8.object({
|
|
538
|
+
kind: z8.literal("learned_reward"),
|
|
487
539
|
rewardModelVersion: ModelProjectImmutableRefSchema,
|
|
488
540
|
qualificationReport: ModelProjectImmutableRefSchema.nullable().default(null),
|
|
489
|
-
evaluationReferences:
|
|
490
|
-
scorerArtifact:
|
|
491
|
-
artifactRef:
|
|
541
|
+
evaluationReferences: z8.array(ModelProjectImmutableRefSchema).max(1e3).default([]),
|
|
542
|
+
scorerArtifact: z8.object({
|
|
543
|
+
artifactRef: z8.string().trim().min(1).max(2e3),
|
|
492
544
|
contentHash: HashSchema3,
|
|
493
545
|
executionReceipt: ModelProjectImmutableRefSchema
|
|
494
546
|
}).strict(),
|
|
495
547
|
processorRelease: ModelProjectImmutableRefSchema,
|
|
496
548
|
rewardComposerRelease: ModelProjectImmutableRefSchema
|
|
497
549
|
}).strict();
|
|
498
|
-
var PolicyOptimizationRequestSchema =
|
|
499
|
-
kind:
|
|
550
|
+
var PolicyOptimizationRequestSchema = z8.object({
|
|
551
|
+
kind: z8.literal("policy_optimize"),
|
|
500
552
|
baseModel: ModelProjectBaseModelSchema,
|
|
501
553
|
recipe: ModelProjectRecipeDocumentSchema,
|
|
502
|
-
rewardSource:
|
|
554
|
+
rewardSource: z8.discriminatedUnion("kind", [
|
|
503
555
|
DeterministicRewardSourceSchema,
|
|
504
556
|
LearnedRewardSourceSchema
|
|
505
557
|
]),
|
|
506
558
|
resumeFrom: ModelProjectImmutableRefSchema.nullable().default(null)
|
|
507
559
|
}).strict();
|
|
508
|
-
var TrainingJobRequestSchema =
|
|
560
|
+
var TrainingJobRequestSchema = z8.discriminatedUnion("kind", [
|
|
509
561
|
RewardModelTrainingRequestSchema,
|
|
510
562
|
PolicyOptimizationRequestSchema
|
|
511
563
|
]);
|
|
512
|
-
var TrainingJobApprovalSchema =
|
|
564
|
+
var TrainingJobApprovalSchema = z8.object({
|
|
513
565
|
approvalHash: HashSchema3,
|
|
514
566
|
approvedAt: TimestampSchema,
|
|
515
|
-
exportApproved:
|
|
516
|
-
maximumSpendUsd:
|
|
517
|
-
retentionDays:
|
|
518
|
-
region:
|
|
567
|
+
exportApproved: z8.boolean(),
|
|
568
|
+
maximumSpendUsd: z8.number().nonnegative(),
|
|
569
|
+
retentionDays: z8.number().int().nonnegative().nullable(),
|
|
570
|
+
region: z8.string().trim().min(1).max(200).nullable().default(null)
|
|
519
571
|
}).strict();
|
|
520
|
-
var TrainingJobSubmissionSchema =
|
|
521
|
-
schemaVersion:
|
|
522
|
-
idempotencyKey:
|
|
523
|
-
name:
|
|
572
|
+
var TrainingJobSubmissionSchema = z8.object({
|
|
573
|
+
schemaVersion: z8.literal("openpond.trainingJobSubmission.v2"),
|
|
574
|
+
idempotencyKey: z8.string().trim().min(1).max(500),
|
|
575
|
+
name: z8.string().trim().min(1).max(200),
|
|
524
576
|
source: TrainingJobSourceSchema,
|
|
525
577
|
job: TrainingJobRequestSchema,
|
|
526
|
-
requestedCapabilities:
|
|
527
|
-
placementObjective:
|
|
528
|
-
budget:
|
|
529
|
-
maximumSpendUsd:
|
|
530
|
-
maximumWallSeconds:
|
|
578
|
+
requestedCapabilities: z8.array(TrainingCapabilityRequirementSchema).max(1e3),
|
|
579
|
+
placementObjective: z8.enum(["fast", "balanced", "economical"]),
|
|
580
|
+
budget: z8.object({
|
|
581
|
+
maximumSpendUsd: z8.number().nonnegative(),
|
|
582
|
+
maximumWallSeconds: z8.number().int().positive()
|
|
531
583
|
}).strict(),
|
|
532
584
|
approval: TrainingJobApprovalSchema,
|
|
533
585
|
contentHash: HashSchema3
|
|
@@ -560,61 +612,61 @@ async function parseAndVerifyTrainingJobSubmission(value) {
|
|
|
560
612
|
}
|
|
561
613
|
return parsed;
|
|
562
614
|
}
|
|
563
|
-
var TrainingJobSchema =
|
|
564
|
-
schemaVersion:
|
|
615
|
+
var TrainingJobSchema = z8.object({
|
|
616
|
+
schemaVersion: z8.literal("openpond.trainingJob.v2"),
|
|
565
617
|
id: IdSchema3,
|
|
566
618
|
teamId: IdSchema3,
|
|
567
619
|
kind: TrainingJobKindSchema,
|
|
568
620
|
modelProjectId: IdSchema3,
|
|
569
621
|
portableProjectId: IdSchema3,
|
|
570
|
-
sourceProjectRevision:
|
|
622
|
+
sourceProjectRevision: z8.number().int().positive(),
|
|
571
623
|
submissionHash: HashSchema3,
|
|
572
624
|
state: TrainingJobStateSchema,
|
|
573
|
-
phase:
|
|
574
|
-
version:
|
|
575
|
-
progress:
|
|
576
|
-
rolloutProgress:
|
|
577
|
-
groupsCompleted:
|
|
578
|
-
groupsTarget:
|
|
579
|
-
optimizerUpdatesApplied:
|
|
580
|
-
optimizerUpdatesSkipped:
|
|
625
|
+
phase: z8.string().trim().min(1).max(200),
|
|
626
|
+
version: z8.number().int().nonnegative(),
|
|
627
|
+
progress: z8.number().min(0).max(1),
|
|
628
|
+
rolloutProgress: z8.object({
|
|
629
|
+
groupsCompleted: z8.number().int().nonnegative(),
|
|
630
|
+
groupsTarget: z8.number().int().nonnegative(),
|
|
631
|
+
optimizerUpdatesApplied: z8.number().int().nonnegative(),
|
|
632
|
+
optimizerUpdatesSkipped: z8.number().int().nonnegative()
|
|
581
633
|
}).strict(),
|
|
582
|
-
accruedSpendUsd:
|
|
583
|
-
terminalReason:
|
|
634
|
+
accruedSpendUsd: z8.number().nonnegative(),
|
|
635
|
+
terminalReason: z8.string().trim().min(1).max(5e3).nullable(),
|
|
584
636
|
createdAt: TimestampSchema,
|
|
585
637
|
updatedAt: TimestampSchema,
|
|
586
638
|
completedAt: TimestampSchema.nullable()
|
|
587
639
|
}).strict();
|
|
588
|
-
var TrainingJobPageSchema =
|
|
589
|
-
schemaVersion:
|
|
590
|
-
jobs:
|
|
591
|
-
nextCursor:
|
|
640
|
+
var TrainingJobPageSchema = z8.object({
|
|
641
|
+
schemaVersion: z8.literal("openpond.trainingJobPage.v2"),
|
|
642
|
+
jobs: z8.array(TrainingJobSchema).max(1e3),
|
|
643
|
+
nextCursor: z8.string().trim().min(1).max(2e3).nullable()
|
|
592
644
|
}).strict();
|
|
593
|
-
var TrainingJobEventSchema =
|
|
594
|
-
schemaVersion:
|
|
645
|
+
var TrainingJobEventSchema = z8.object({
|
|
646
|
+
schemaVersion: z8.literal("openpond.trainingJobEvent.v2"),
|
|
595
647
|
id: IdSchema3,
|
|
596
648
|
jobId: IdSchema3,
|
|
597
|
-
sequence:
|
|
649
|
+
sequence: z8.number().int().nonnegative(),
|
|
598
650
|
type: IdSchema3,
|
|
599
|
-
phase:
|
|
600
|
-
message:
|
|
601
|
-
data:
|
|
651
|
+
phase: z8.string().trim().min(1).max(200),
|
|
652
|
+
message: z8.string().trim().min(1).max(5e3).nullable(),
|
|
653
|
+
data: z8.record(z8.string(), z8.unknown()).default({}),
|
|
602
654
|
createdAt: TimestampSchema
|
|
603
655
|
}).strict();
|
|
604
|
-
var TrainingJobLogSchema =
|
|
605
|
-
schemaVersion:
|
|
656
|
+
var TrainingJobLogSchema = z8.object({
|
|
657
|
+
schemaVersion: z8.literal("openpond.trainingJobLog.v2"),
|
|
606
658
|
jobId: IdSchema3,
|
|
607
|
-
sequence:
|
|
608
|
-
level:
|
|
609
|
-
message:
|
|
659
|
+
sequence: z8.number().int().nonnegative(),
|
|
660
|
+
level: z8.enum(["debug", "info", "warning", "error"]),
|
|
661
|
+
message: z8.string().max(2e4),
|
|
610
662
|
createdAt: TimestampSchema
|
|
611
663
|
}).strict();
|
|
612
|
-
var TrainingJobControlRequestSchema =
|
|
613
|
-
var TrainingJobOutputSchema =
|
|
614
|
-
schemaVersion:
|
|
664
|
+
var TrainingJobControlRequestSchema = z8.object({ expectedVersion: z8.number().int().nonnegative() }).strict();
|
|
665
|
+
var TrainingJobOutputSchema = z8.object({
|
|
666
|
+
schemaVersion: z8.literal("openpond.trainingJobOutput.v2"),
|
|
615
667
|
id: IdSchema3,
|
|
616
668
|
jobId: IdSchema3,
|
|
617
|
-
kind:
|
|
669
|
+
kind: z8.enum([
|
|
618
670
|
"checkpoint",
|
|
619
671
|
"adapter",
|
|
620
672
|
"scorer",
|
|
@@ -623,14 +675,14 @@ var TrainingJobOutputSchema = z7.object({
|
|
|
623
675
|
"trace",
|
|
624
676
|
"receipt"
|
|
625
677
|
]),
|
|
626
|
-
artifactRef:
|
|
678
|
+
artifactRef: z8.string().trim().min(1).max(2e3),
|
|
627
679
|
contentHash: HashSchema3,
|
|
628
|
-
sizeBytes:
|
|
629
|
-
metadata:
|
|
680
|
+
sizeBytes: z8.number().int().nonnegative(),
|
|
681
|
+
metadata: z8.record(z8.string(), z8.unknown()).default({}),
|
|
630
682
|
createdAt: TimestampSchema
|
|
631
683
|
}).strict();
|
|
632
|
-
var TrainingExecutionReceiptSchema =
|
|
633
|
-
schemaVersion:
|
|
684
|
+
var TrainingExecutionReceiptSchema = z8.object({
|
|
685
|
+
schemaVersion: z8.literal("openpond.trainingExecutionReceipt.v2"),
|
|
634
686
|
id: IdSchema3,
|
|
635
687
|
teamId: IdSchema3,
|
|
636
688
|
jobId: IdSchema3,
|
|
@@ -639,14 +691,14 @@ var TrainingExecutionReceiptSchema = z7.object({
|
|
|
639
691
|
recipeHash: HashSchema3,
|
|
640
692
|
capabilityHash: HashSchema3,
|
|
641
693
|
runtimeRelease: ModelProjectImmutableRefSchema,
|
|
642
|
-
inputs:
|
|
643
|
-
outputs:
|
|
644
|
-
spendUsd:
|
|
645
|
-
durationSeconds:
|
|
646
|
-
cleanupComplete:
|
|
694
|
+
inputs: z8.array(ModelProjectImmutableRefSchema).max(1e4),
|
|
695
|
+
outputs: z8.array(ModelProjectImmutableRefSchema).max(1e4),
|
|
696
|
+
spendUsd: z8.number().nonnegative(),
|
|
697
|
+
durationSeconds: z8.number().nonnegative(),
|
|
698
|
+
cleanupComplete: z8.boolean(),
|
|
647
699
|
issuer: IdSchema3,
|
|
648
700
|
issuedAt: TimestampSchema,
|
|
649
|
-
signature:
|
|
701
|
+
signature: z8.string().trim().min(1).max(1e4).nullable()
|
|
650
702
|
}).strict();
|
|
651
703
|
async function trainingExecutionReceiptHash(receipt) {
|
|
652
704
|
return canonicalSha256(TrainingExecutionReceiptSchema.parse(receipt));
|
|
@@ -682,18 +734,18 @@ async function parseAndVerifyTrainingExecutionReceipt(value, expected) {
|
|
|
682
734
|
}
|
|
683
735
|
return receipt;
|
|
684
736
|
}
|
|
685
|
-
var TrainingJobOutputsSchema =
|
|
686
|
-
schemaVersion:
|
|
687
|
-
outputs:
|
|
737
|
+
var TrainingJobOutputsSchema = z8.object({
|
|
738
|
+
schemaVersion: z8.literal("openpond.trainingJobOutputs.v2"),
|
|
739
|
+
outputs: z8.array(TrainingJobOutputSchema).max(1e4),
|
|
688
740
|
receipt: TrainingExecutionReceiptSchema.nullable()
|
|
689
741
|
}).strict();
|
|
690
|
-
var TrainingApiErrorSchema =
|
|
691
|
-
schemaVersion:
|
|
692
|
-
code:
|
|
693
|
-
message:
|
|
694
|
-
retryable:
|
|
695
|
-
requestId:
|
|
696
|
-
details:
|
|
742
|
+
var TrainingApiErrorSchema = z8.object({
|
|
743
|
+
schemaVersion: z8.literal("openpond.trainingApiError.v2"),
|
|
744
|
+
code: z8.string().trim().min(1).max(200),
|
|
745
|
+
message: z8.string().trim().min(1).max(5e3),
|
|
746
|
+
retryable: z8.boolean().default(false),
|
|
747
|
+
requestId: z8.string().trim().min(1).max(500).nullable().default(null),
|
|
748
|
+
details: z8.record(z8.string(), z8.unknown()).default({})
|
|
697
749
|
}).strict();
|
|
698
750
|
var OpenPondTrainingApiError = class extends Error {
|
|
699
751
|
status;
|
|
@@ -711,23 +763,23 @@ var OpenPondTrainingApiError = class extends Error {
|
|
|
711
763
|
this.details = error.details;
|
|
712
764
|
}
|
|
713
765
|
};
|
|
714
|
-
var TrainingCapabilitiesSchema =
|
|
715
|
-
schemaVersion:
|
|
766
|
+
var TrainingCapabilitiesSchema = z8.object({
|
|
767
|
+
schemaVersion: z8.literal("openpond.trainingCapabilities.v2"),
|
|
716
768
|
capabilityHash: HashSchema3,
|
|
717
|
-
jobKinds:
|
|
718
|
-
methods:
|
|
719
|
-
placements:
|
|
720
|
-
|
|
769
|
+
jobKinds: z8.array(TrainingJobKindSchema),
|
|
770
|
+
methods: z8.array(z8.string().trim().min(1).max(200)),
|
|
771
|
+
placements: z8.array(
|
|
772
|
+
z8.enum(["local", "remote", "colocated", "provider_native"])
|
|
721
773
|
),
|
|
722
|
-
controls:
|
|
723
|
-
cancel:
|
|
724
|
-
stopAfterGroup:
|
|
725
|
-
resumeFromCheckpoint:
|
|
774
|
+
controls: z8.object({
|
|
775
|
+
cancel: z8.boolean(),
|
|
776
|
+
stopAfterGroup: z8.boolean(),
|
|
777
|
+
resumeFromCheckpoint: z8.boolean()
|
|
726
778
|
}).strict(),
|
|
727
|
-
limits:
|
|
728
|
-
maximumSpendUsd:
|
|
729
|
-
maximumWallSeconds:
|
|
730
|
-
maximumArtifactBytes:
|
|
779
|
+
limits: z8.object({
|
|
780
|
+
maximumSpendUsd: z8.number().nonnegative(),
|
|
781
|
+
maximumWallSeconds: z8.number().int().positive(),
|
|
782
|
+
maximumArtifactBytes: z8.number().int().positive()
|
|
731
783
|
}).strict(),
|
|
732
784
|
checkedAt: TimestampSchema,
|
|
733
785
|
expiresAt: TimestampSchema
|
|
@@ -784,6 +836,7 @@ function createTrainingClient(input) {
|
|
|
784
836
|
}
|
|
785
837
|
return {
|
|
786
838
|
...createTrainingPreparationClient(request),
|
|
839
|
+
...createTrainingAcceptanceClient(request),
|
|
787
840
|
...createTrainingHarnessSourceClient(request),
|
|
788
841
|
...createTrainingCandidateDecisionClient(request),
|
|
789
842
|
async capabilities() {
|
|
@@ -821,12 +874,12 @@ function createTrainingClient(input) {
|
|
|
821
874
|
parameters.set("modelProjectId", IdSchema3.parse(options.modelProjectId));
|
|
822
875
|
}
|
|
823
876
|
if (options.cursor) {
|
|
824
|
-
parameters.set("cursor",
|
|
877
|
+
parameters.set("cursor", z8.string().trim().min(1).max(2e3).parse(options.cursor));
|
|
825
878
|
}
|
|
826
879
|
if (options.limit !== void 0) {
|
|
827
880
|
parameters.set(
|
|
828
881
|
"limit",
|
|
829
|
-
String(
|
|
882
|
+
String(z8.number().int().min(1).max(1e3).parse(options.limit))
|
|
830
883
|
);
|
|
831
884
|
}
|
|
832
885
|
const query = parameters.size > 0 ? `?${parameters.toString()}` : "";
|
|
@@ -867,7 +920,7 @@ function createTrainingClient(input) {
|
|
|
867
920
|
);
|
|
868
921
|
},
|
|
869
922
|
async events(jobId) {
|
|
870
|
-
return
|
|
923
|
+
return z8.array(TrainingJobEventSchema).parse(
|
|
871
924
|
unwrapObject(
|
|
872
925
|
await request(
|
|
873
926
|
`/v1/training/jobs/${encodeURIComponent(IdSchema3.parse(jobId))}/events`
|
|
@@ -887,10 +940,10 @@ function createTrainingClient(input) {
|
|
|
887
940
|
const id = IdSchema3.parse(jobId);
|
|
888
941
|
const reference = ModelProjectImmutableRefSchema.parse(evaluation);
|
|
889
942
|
const parameters = new URLSearchParams();
|
|
890
|
-
const cursor = options.cursor === void 0 ? void 0 :
|
|
891
|
-
const offset = cursor === void 0 ? 0 :
|
|
943
|
+
const cursor = options.cursor === void 0 ? void 0 : z8.string().regex(/^[1-9]\d*$/).parse(options.cursor);
|
|
944
|
+
const offset = cursor === void 0 ? 0 : z8.number().int().min(1).max(9999).parse(Number(cursor));
|
|
892
945
|
if (cursor !== void 0) parameters.set("cursor", cursor);
|
|
893
|
-
if (options.limit !== void 0) parameters.set("limit", String(
|
|
946
|
+
if (options.limit !== void 0) parameters.set("limit", String(z8.number().int().min(1).max(100).parse(options.limit)));
|
|
894
947
|
const query = parameters.size ? `?${parameters.toString()}` : "";
|
|
895
948
|
return parseAndVerifyTrainingEvaluationTaskPage(
|
|
896
949
|
await request(`/v1/training/jobs/${encodeURIComponent(id)}/evaluations/${encodeURIComponent(reference.id)}/tasks${query}`),
|
|
@@ -898,7 +951,7 @@ function createTrainingClient(input) {
|
|
|
898
951
|
);
|
|
899
952
|
},
|
|
900
953
|
async logs(jobId) {
|
|
901
|
-
return
|
|
954
|
+
return z8.array(TrainingJobLogSchema).max(1e5).parse(
|
|
902
955
|
unwrapObject(
|
|
903
956
|
await request(
|
|
904
957
|
`/v1/training/jobs/${encodeURIComponent(IdSchema3.parse(jobId))}/logs`
|
|
@@ -935,6 +988,10 @@ function trainingApiError(value, status) {
|
|
|
935
988
|
}
|
|
936
989
|
|
|
937
990
|
export {
|
|
991
|
+
TrainingAcceptanceGroupReferenceSchema,
|
|
992
|
+
TrainingAcceptanceGroupSummarySchema,
|
|
993
|
+
TrainingAcceptanceGroupPageSchema,
|
|
994
|
+
TrainingAcceptanceGroupQuerySchema,
|
|
938
995
|
TrainingPreparationRequestSchema,
|
|
939
996
|
TrainingPreparationPlanContentSchema,
|
|
940
997
|
TrainingPreparationPlanSchema,
|
|
@@ -987,4 +1044,4 @@ export {
|
|
|
987
1044
|
TrainingCapabilitiesSchema,
|
|
988
1045
|
createTrainingClient
|
|
989
1046
|
};
|
|
990
|
-
//# sourceMappingURL=chunk-
|
|
1047
|
+
//# sourceMappingURL=chunk-JCPLAIZL.js.map
|