runbios-sdk 0.2.20 → 0.2.21-dev.297
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/dist/client.js +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/resources/inference.js +1 -1
- package/dist/resources/loop.d.ts +92 -15
- package/dist/resources/loop.js +132 -17
- package/dist/types.d.ts +716 -54
- package/package.json +1 -1
package/dist/types.d.ts
CHANGED
|
@@ -8,13 +8,13 @@ export interface BiOSConfig {
|
|
|
8
8
|
orgId?: string;
|
|
9
9
|
/** Workspace ID. Optional when using API keys (resolved from the key). Can override for multi-workspace keys. */
|
|
10
10
|
workspaceId?: string;
|
|
11
|
-
/** Base URL for the API. Falls back to the RUNBIOS_BASE_URL environment variable (legacy: BIOS_BASE_URL), then the canonical https://api.runbios.ai hostname. */
|
|
11
|
+
/** Base URL for the API. Falls back to the RUNBIOS_BASE_URL environment variable (legacy: BIOS_BASE_URL), then the canonical https://api-dev.runbios.ai hostname. */
|
|
12
12
|
baseUrl?: string;
|
|
13
13
|
/** Request timeout in milliseconds. Defaults to 30000. */
|
|
14
14
|
timeout?: number;
|
|
15
15
|
/** Default per-deployment inference key. Can be overridden per inference call. */
|
|
16
16
|
inferenceKey?: string;
|
|
17
|
-
/** Inference base URL. Defaults to baseUrl, then https://api.runbios.ai. */
|
|
17
|
+
/** Inference base URL. Defaults to baseUrl, then https://api-dev.runbios.ai. */
|
|
18
18
|
inferenceBaseUrl?: string;
|
|
19
19
|
/** End-to-end inference timeout in milliseconds. Defaults to 15 minutes. */
|
|
20
20
|
inferenceTimeout?: number;
|
|
@@ -178,14 +178,6 @@ export interface Model {
|
|
|
178
178
|
/** Run BiOS-side usage rollups for this model. */
|
|
179
179
|
train_count?: number;
|
|
180
180
|
inference_count?: number;
|
|
181
|
-
verified_at?: string | null;
|
|
182
|
-
/** Per-surface verification badges plus the image build that passed. */
|
|
183
|
-
training_verified?: boolean;
|
|
184
|
-
training_verified_at?: string | null;
|
|
185
|
-
training_verified_image?: string;
|
|
186
|
-
inference_verified?: boolean;
|
|
187
|
-
inference_verified_at?: string | null;
|
|
188
|
-
inference_verified_image?: string;
|
|
189
181
|
updated_at?: string;
|
|
190
182
|
/**
|
|
191
183
|
* Native max context window in tokens -- the ceiling a deployment's
|
|
@@ -757,6 +749,14 @@ export interface TrainingJob {
|
|
|
757
749
|
has_cached_dataset?: boolean;
|
|
758
750
|
final_model_s3_key?: string | null;
|
|
759
751
|
final_artifact_verified?: boolean;
|
|
752
|
+
/** Final model of a completed run: 'verified' (stored), 'deleted' (was saved and
|
|
753
|
+
* verified, then deleted on purpose; not a failed save), 'unavailable' (never
|
|
754
|
+
* committed). '' for runs that are not completed; absent on older backends. */
|
|
755
|
+
final_artifact_state?: 'verified' | 'deleted' | 'unavailable' | '';
|
|
756
|
+
/** When a 'deleted' final model was removed. */
|
|
757
|
+
final_artifact_deleted_at?: string | null;
|
|
758
|
+
/** Who removed it: 'you' | 'member' | 'system:pipeline_deleted' | 'system:save_total_limit' | other 'system:*'. */
|
|
759
|
+
final_artifact_deleted_by?: string | null;
|
|
760
760
|
mix_manifest?: Record<string, unknown> | null;
|
|
761
761
|
preserve_on_stop?: boolean;
|
|
762
762
|
desired_state?: 'running' | 'stopped';
|
|
@@ -2784,6 +2784,7 @@ export interface LoopMetricPoint {
|
|
|
2784
2784
|
mean_delta: number | null;
|
|
2785
2785
|
judge_incumbent_mean: number | null;
|
|
2786
2786
|
judge_candidate_mean: number | null;
|
|
2787
|
+
/** The trainer's loss on its validation slice, as {@link Evaluation.trainer_eval_loss}. */
|
|
2787
2788
|
trainer_eval_loss: number | null;
|
|
2788
2789
|
/** The bar this attempt had to clear, frozen with its report. */
|
|
2789
2790
|
promote_margin: number | null;
|
|
@@ -2901,9 +2902,34 @@ export type TrainingRunState = 'built' | 'registering' | 'dataset_validating' |
|
|
|
2901
2902
|
/** The closed set a run never leaves. */
|
|
2902
2903
|
export declare const TERMINAL_RUN_STATES: readonly TrainingRunState[];
|
|
2903
2904
|
export type TrainingVerdict = 'better' | 'not_better' | 'inconclusive' | 'not_evaluated';
|
|
2904
|
-
|
|
2905
|
+
/**
|
|
2906
|
+
* What was decided about a compared attempt, and who decided: `promoted` (a
|
|
2907
|
+
* member put it live), `auto_promoted`, `rejected` (a member chose not to
|
|
2908
|
+
* publish it), `auto_rejected` (the pipeline's rule turned it down on its
|
|
2909
|
+
* own), `expired` (nobody decided before the review deadline, so it was
|
|
2910
|
+
* retired; its verdict, `better` included, stands) or `rolled_back`.
|
|
2911
|
+
*/
|
|
2912
|
+
export type TrainingDecision = 'auto_promoted' | 'promoted' | 'rejected' | 'auto_rejected' | 'expired' | 'rolled_back';
|
|
2905
2913
|
export type EvaluationStatus = 'open' | 'done' | 'failed' | 'budget_stopped';
|
|
2906
2914
|
export type EvaluationItemStatus = 'pending' | 'working' | 'done' | 'failed';
|
|
2915
|
+
/**
|
|
2916
|
+
* Why a failed conversation of a report failed (`error_code` on both items
|
|
2917
|
+
* routes), from a closed set; the row's `error` is the sentence for a person.
|
|
2918
|
+
* unreadable / unprepared: the conversation could not be read or prepared to
|
|
2919
|
+
* be asked. too_large_to_keep: too large to keep in storage. no_right_answer:
|
|
2920
|
+
* an exact-check benchmark's conversation with no right answer.
|
|
2921
|
+
* incumbent_unanswered / candidate_unanswered / scorer_failed: on its last
|
|
2922
|
+
* try the other side, or the new model, could not answer, or an answer could
|
|
2923
|
+
* not be scored. ended_outage / ended_deployment_stopped / ended_unscorable:
|
|
2924
|
+
* the comparison ended before it (an outage on the platform's side, a
|
|
2925
|
+
* stopped deployment, nothing able to score it). run_ended / replay_ended: its
|
|
2926
|
+
* attempt or replay ended first. answers_not_kept: replayed, its answers
|
|
2927
|
+
* held until storage could keep them, and storage could not before the
|
|
2928
|
+
* replay ended (a conversation never asked is replay_ended). not_finished:
|
|
2929
|
+
* its tries (or the comparison's money) ran out with nothing more particular
|
|
2930
|
+
* recorded.
|
|
2931
|
+
*/
|
|
2932
|
+
export type ItemErrorCode = 'unreadable' | 'unprepared' | 'too_large_to_keep' | 'no_right_answer' | 'incumbent_unanswered' | 'candidate_unanswered' | 'scorer_failed' | 'ended_outage' | 'ended_deployment_stopped' | 'ended_unscorable' | 'run_ended' | 'replay_ended' | 'answers_not_kept' | 'not_finished';
|
|
2907
2933
|
export type EvaluationWinner = 'candidate' | 'incumbent' | 'tie';
|
|
2908
2934
|
/** Typed warning codes. Each surface renders its own plain sentence. */
|
|
2909
2935
|
export type EvaluationWarningCode = 'holdout_too_small' | 'judge_unreliable' | 'graders_not_applied' | 'many_failures' | 'no_judge' | 'judge_labelled_training_rows' | 'capture_source_moved';
|
|
@@ -3005,6 +3031,7 @@ export interface TrainingRun {
|
|
|
3005
3031
|
train_rows: number | null;
|
|
3006
3032
|
holdout_rows: number | null;
|
|
3007
3033
|
train_dataset_id: string | null;
|
|
3034
|
+
/** Null on a run made since the held-back rows stopped leaving the loop; set on older runs. */
|
|
3008
3035
|
holdout_dataset_id: string | null;
|
|
3009
3036
|
training_job_id: string | null;
|
|
3010
3037
|
job_status: string | null;
|
|
@@ -3029,6 +3056,7 @@ export interface TrainingRun {
|
|
|
3029
3056
|
model_family: string | null;
|
|
3030
3057
|
/** Machine time the run held (training job plus comparison machine); null until known. */
|
|
3031
3058
|
gpu_seconds: number | null;
|
|
3059
|
+
/** The trainer's loss on its validation slice, as {@link Evaluation.trainer_eval_loss}. */
|
|
3032
3060
|
training_eval_loss: number | null;
|
|
3033
3061
|
candidate_deployment_id: string | null;
|
|
3034
3062
|
candidate_name: string | null;
|
|
@@ -3119,6 +3147,7 @@ export interface TrainingRunEvent {
|
|
|
3119
3147
|
export interface TrainingRunLinks {
|
|
3120
3148
|
training_job_url: string | null;
|
|
3121
3149
|
candidate_url: string | null;
|
|
3150
|
+
/** The console page of this attempt's comparison report, every conversation included. */
|
|
3122
3151
|
evaluation_url: string | null;
|
|
3123
3152
|
/** The TREND the benchmark number belongs to, not the one replay. */
|
|
3124
3153
|
benchmark_url: string | null;
|
|
@@ -3189,8 +3218,25 @@ export interface Evaluation {
|
|
|
3189
3218
|
mean_delta: number | null;
|
|
3190
3219
|
judge_incumbent_mean: number | null;
|
|
3191
3220
|
judge_candidate_mean: number | null;
|
|
3221
|
+
/**
|
|
3222
|
+
* An answer PASSED (score 0.70 or more) when the judge scored it at least
|
|
3223
|
+
* `pass_threshold`; an answer with no score never passes. `*_passed`
|
|
3224
|
+
* counts the conversations each side passed, and `*_pass_rate` is that
|
|
3225
|
+
* count over `rows_scored`. The counts are null until the report is
|
|
3226
|
+
* finished, and the rates also when nothing was scored.
|
|
3227
|
+
*/
|
|
3228
|
+
pass_threshold: number;
|
|
3229
|
+
incumbent_passed: number | null;
|
|
3230
|
+
candidate_passed: number | null;
|
|
3231
|
+
incumbent_pass_rate: number | null;
|
|
3232
|
+
candidate_pass_rate: number | null;
|
|
3192
3233
|
per_dimension: EvaluationDimensionScore[];
|
|
3193
|
-
/**
|
|
3234
|
+
/**
|
|
3235
|
+
* The trainer's loss on its validation slice: about 5% of the rows the
|
|
3236
|
+
* attempt trains on, kept aside to pick the best checkpoint. Informational:
|
|
3237
|
+
* there is no incumbent counterpart to compare it against, and it is not
|
|
3238
|
+
* measured on the held-back conversations this report compares.
|
|
3239
|
+
*/
|
|
3194
3240
|
trainer_eval_loss: number | null;
|
|
3195
3241
|
warnings: EvaluationWarning[];
|
|
3196
3242
|
verdict: TrainingVerdict | null;
|
|
@@ -3204,12 +3250,61 @@ export interface Evaluation {
|
|
|
3204
3250
|
created_at: string;
|
|
3205
3251
|
finished_at: string | null;
|
|
3206
3252
|
}
|
|
3253
|
+
/**
|
|
3254
|
+
* What the judge made of one answer: its overall score, one score per rubric
|
|
3255
|
+
* dimension (keyed as `judge_dimensions` names them), and the judge's reason
|
|
3256
|
+
* in its own words, with anything that looks like a credential or a personal
|
|
3257
|
+
* detail removed. `reason` is null when the judge gave none.
|
|
3258
|
+
*/
|
|
3259
|
+
export interface EvaluationItemJudge {
|
|
3260
|
+
overall: number;
|
|
3261
|
+
dimensions: Record<string, number>;
|
|
3262
|
+
reason: string | null;
|
|
3263
|
+
}
|
|
3264
|
+
/**
|
|
3265
|
+
* Where a conversation's reference answer came from: a person said the
|
|
3266
|
+
* model's own answer was `good`, a person's `correction`, or a `gold` answer
|
|
3267
|
+
* written as the right one.
|
|
3268
|
+
*/
|
|
3269
|
+
export type EvaluationReferenceKind = 'good' | 'correction' | 'gold';
|
|
3270
|
+
/**
|
|
3271
|
+
* What a person said the right answer is, frozen with the report and shown
|
|
3272
|
+
* to the judge beside both answers. Null on a conversation nobody gave one.
|
|
3273
|
+
*
|
|
3274
|
+
* A right answer is its text AND the tool calls it makes: an answer marked
|
|
3275
|
+
* good that only calls a tool has `answer` `""` and its calls.
|
|
3276
|
+
* `tool_calls` is null when it makes none.
|
|
3277
|
+
*/
|
|
3278
|
+
export interface EvaluationReference {
|
|
3279
|
+
answer: string;
|
|
3280
|
+
kind: EvaluationReferenceKind;
|
|
3281
|
+
tool_calls: TrainingToolCall[] | null;
|
|
3282
|
+
}
|
|
3283
|
+
/** Which answer the judge preferred in one order of showing them, and why. */
|
|
3284
|
+
export interface EvaluationPairwiseOrder {
|
|
3285
|
+
winner: EvaluationWinner;
|
|
3286
|
+
reason: string | null;
|
|
3287
|
+
}
|
|
3288
|
+
/**
|
|
3289
|
+
* The direct comparison, asked twice: once with the serving version's answer
|
|
3290
|
+
* shown first and once with the attempt's first. A win counts only when both
|
|
3291
|
+
* orders pick the same side (`agreed`); anything else is a `tie`, which is
|
|
3292
|
+
* what removes the judge's preference for whichever answer it reads first.
|
|
3293
|
+
*/
|
|
3294
|
+
export interface EvaluationItemPairwise {
|
|
3295
|
+
incumbent_first: EvaluationPairwiseOrder;
|
|
3296
|
+
candidate_first: EvaluationPairwiseOrder;
|
|
3297
|
+
winner: EvaluationWinner;
|
|
3298
|
+
agreed: boolean;
|
|
3299
|
+
}
|
|
3207
3300
|
/** One model's answer to one held-out conversation, with the scores it earned. */
|
|
3208
3301
|
export interface EvaluationItemSide {
|
|
3209
3302
|
completion: string | null;
|
|
3210
3303
|
tool_calls: TrainingToolCall[] | null;
|
|
3211
|
-
judge:
|
|
3304
|
+
judge: EvaluationItemJudge | null;
|
|
3212
3305
|
score: number | null;
|
|
3306
|
+
/** True when it passed (score 0.70 or more); null when it has no score. */
|
|
3307
|
+
passed: boolean | null;
|
|
3213
3308
|
model_version: string | null;
|
|
3214
3309
|
}
|
|
3215
3310
|
/**
|
|
@@ -3225,12 +3320,17 @@ export interface EvaluationItem {
|
|
|
3225
3320
|
trace_url: string | null;
|
|
3226
3321
|
prompt: TrainingMessage[];
|
|
3227
3322
|
tools: unknown[] | null;
|
|
3323
|
+
reference: EvaluationReference | null;
|
|
3228
3324
|
incumbent: EvaluationItemSide;
|
|
3229
3325
|
candidate: EvaluationItemSide;
|
|
3326
|
+
/** Null on a conversation compared before both orders were kept. */
|
|
3327
|
+
pairwise: EvaluationItemPairwise | null;
|
|
3230
3328
|
human_verdict: number | null;
|
|
3231
3329
|
winner: EvaluationWinner | null;
|
|
3232
3330
|
status: EvaluationItemStatus;
|
|
3233
3331
|
error: string | null;
|
|
3332
|
+
/** Why the row failed; null unless it failed, and on a row failed before causes were kept. */
|
|
3333
|
+
error_code: ItemErrorCode | null;
|
|
3234
3334
|
}
|
|
3235
3335
|
/**
|
|
3236
3336
|
* Which pairs to read: the ones the attempt won (`candidate`), the ones the
|
|
@@ -3238,8 +3338,40 @@ export interface EvaluationItem {
|
|
|
3238
3338
|
* or the ties.
|
|
3239
3339
|
*/
|
|
3240
3340
|
export type EvaluationItemWinnerFilter = 'candidate' | 'serving' | 'tie';
|
|
3341
|
+
/** A row's status: scored, or failed (could not be scored). */
|
|
3342
|
+
export type ReportStatusFilter = 'scored' | 'failed';
|
|
3343
|
+
/**
|
|
3344
|
+
* The order of a report's rows: its own (`ordinal`, the default), or the new
|
|
3345
|
+
* model's score less the other's, largest first (`score_change`).
|
|
3346
|
+
*/
|
|
3347
|
+
export type ReportSort = 'ordinal' | 'score_change';
|
|
3348
|
+
/**
|
|
3349
|
+
* Which rows of a report to read, and in what order. Every filter narrows the
|
|
3350
|
+
* page and `total` alike; a value the service does not take is refused 400
|
|
3351
|
+
* naming it. `candidate_passed` and `incumbent_passed` are one side each and
|
|
3352
|
+
* compose: `true` is that side's answer passed (score 0.70 or more), `false`
|
|
3353
|
+
* that it was scored below 0.70, and a side with no score matches neither --
|
|
3354
|
+
* `candidate_passed: false, incumbent_passed: true` is the regressions,
|
|
3355
|
+
* `candidate_passed: false` alone every row the new model did not pass.
|
|
3356
|
+
* `q` (2 to 200 characters) searches, case-insensitively, what a
|
|
3357
|
+
* reader of each row sees -- the conversation (not the system prompt every row
|
|
3358
|
+
* shares), the right answer, both answers
|
|
3359
|
+
* and their tool calls, every reason -- read from storage by the service; the
|
|
3360
|
+
* answer's `searched` says how many rows it searched. A search can be refused
|
|
3361
|
+
* 429 `RATE_LIMITED`, with `Retry-After`, while this workspace already has a
|
|
3362
|
+
* search running or while the service is running as many searches as it can
|
|
3363
|
+
* at once; try again after `Retry-After` seconds (the message says how many).
|
|
3364
|
+
*/
|
|
3241
3365
|
export interface EvaluationItemListParams {
|
|
3242
3366
|
winner?: EvaluationItemWinnerFilter;
|
|
3367
|
+
candidate_passed?: boolean;
|
|
3368
|
+
incumbent_passed?: boolean;
|
|
3369
|
+
/** Whether the two side-by-side orders picked the same side. */
|
|
3370
|
+
orders?: 'agreed' | 'disagreed';
|
|
3371
|
+
has_reference?: boolean;
|
|
3372
|
+
status?: ReportStatusFilter;
|
|
3373
|
+
sort?: ReportSort;
|
|
3374
|
+
q?: string;
|
|
3243
3375
|
/** 50 when absent; at most 200. */
|
|
3244
3376
|
limit?: number;
|
|
3245
3377
|
offset?: number;
|
|
@@ -3290,11 +3422,31 @@ export type BenchmarkRunStatus = 'open' | 'done' | 'failed' | 'budget_stopped' |
|
|
|
3290
3422
|
* is a missing number, never a lower one.
|
|
3291
3423
|
*/
|
|
3292
3424
|
export interface BenchmarkScoring {
|
|
3425
|
+
/** `judge_overall` (a scoring model) or `exact_match` (the exact check). */
|
|
3293
3426
|
metric: string;
|
|
3294
3427
|
scale: string;
|
|
3295
3428
|
aggregate: string;
|
|
3296
3429
|
require_all_rows: boolean;
|
|
3297
3430
|
}
|
|
3431
|
+
/**
|
|
3432
|
+
* How a benchmark's answers are scored, chosen when it is made and frozen:
|
|
3433
|
+
*
|
|
3434
|
+
* - `judge` (the default): a scoring model reads both answers against the
|
|
3435
|
+
* right answer, as for the held-back set.
|
|
3436
|
+
* - `exact`: the answer or the tool call must match the right answer, and no
|
|
3437
|
+
* model is asked. When the right answer calls tools, the answer must make
|
|
3438
|
+
* the same calls (the same tools with JSON-equal arguments, in any order,
|
|
3439
|
+
* none left out and none extra; its text is not read); otherwise its text
|
|
3440
|
+
* must be the right answer's ignoring case and spacing, or both the same
|
|
3441
|
+
* number (a currency or percent sign on one side only is ignored; `$20` is
|
|
3442
|
+
* not `20%` or `€20`). 1 or 0, and each side's `judge` is
|
|
3443
|
+
* `{overall, dimensions: {match}, reason}`, the reason saying what matched
|
|
3444
|
+
* or what differed. Every conversation needs a right answer. A value hidden
|
|
3445
|
+
* when the conversation was captured (an email, a long number, an IP
|
|
3446
|
+
* address or a key, kept as `[redacted:...]`) cannot be checked: an answer
|
|
3447
|
+
* that matches everywhere else still scores 0, and the reason says so.
|
|
3448
|
+
*/
|
|
3449
|
+
export type BenchmarkCheck = 'judge' | 'exact';
|
|
3298
3450
|
/**
|
|
3299
3451
|
* One rubric dimension of one replay, for both models.
|
|
3300
3452
|
*
|
|
@@ -3307,6 +3459,19 @@ export interface BenchmarkDimensionScore {
|
|
|
3307
3459
|
candidate: number;
|
|
3308
3460
|
delta: number;
|
|
3309
3461
|
}
|
|
3462
|
+
/**
|
|
3463
|
+
* What a pipeline's history, or a benchmark's pinned set, takes up in storage
|
|
3464
|
+
* right now. Conversations, answers and scoring, and the training rows of a
|
|
3465
|
+
* pipeline's curated sets, are kept in storage only, never in the database. Not billed; it counts toward the workspace's storage
|
|
3466
|
+
* quota and is deleted with the pipeline (a benchmark's with the workspace).
|
|
3467
|
+
* `where` is null while nothing is stored.
|
|
3468
|
+
*/
|
|
3469
|
+
export type LoopStorageWhere = 'platform' | 'your_storage' | 'both';
|
|
3470
|
+
export interface LoopStorage {
|
|
3471
|
+
bytes: number;
|
|
3472
|
+
objects: number;
|
|
3473
|
+
where: LoopStorageWhere | null;
|
|
3474
|
+
}
|
|
3310
3475
|
/**
|
|
3311
3476
|
* The frozen definition: the oracle, the scoring rule and the fingerprint of
|
|
3312
3477
|
* the set. The conversations themselves are their own paged route.
|
|
@@ -3316,6 +3481,11 @@ export interface Benchmark {
|
|
|
3316
3481
|
workspace_id: string;
|
|
3317
3482
|
name: string;
|
|
3318
3483
|
status: BenchmarkStatus;
|
|
3484
|
+
/**
|
|
3485
|
+
* How its answers are scored (`scoring.metric` read out). On an `exact`
|
|
3486
|
+
* benchmark `judge_model` is `""` and the judge fields describe the check.
|
|
3487
|
+
*/
|
|
3488
|
+
check: BenchmarkCheck;
|
|
3319
3489
|
/** Provenance only: everything needed from the judge is copied below it. */
|
|
3320
3490
|
judge_id: string | null;
|
|
3321
3491
|
judge_name: string;
|
|
@@ -3331,6 +3501,8 @@ export interface Benchmark {
|
|
|
3331
3501
|
created_at: string;
|
|
3332
3502
|
retired_at: string | null;
|
|
3333
3503
|
retired_by: string | null;
|
|
3504
|
+
/** What the pinned set takes up in storage. */
|
|
3505
|
+
storage: LoopStorage;
|
|
3334
3506
|
}
|
|
3335
3507
|
/**
|
|
3336
3508
|
* One pinned conversation.
|
|
@@ -3347,15 +3519,22 @@ export interface BenchmarkItem {
|
|
|
3347
3519
|
source_trace_url: string | null;
|
|
3348
3520
|
prompt: TrainingMessage[];
|
|
3349
3521
|
tools: unknown[] | null;
|
|
3522
|
+
/** The right answer pinned with it, calls and all; null when nobody gave one. */
|
|
3523
|
+
reference: EvaluationReference | null;
|
|
3350
3524
|
}
|
|
3351
3525
|
/**
|
|
3352
3526
|
* One replay: this benchmark, on this training run, against both models.
|
|
3353
3527
|
*
|
|
3354
|
-
* IT
|
|
3355
|
-
*
|
|
3356
|
-
* cancels in its delta; an absolute
|
|
3357
|
-
*
|
|
3358
|
-
*
|
|
3528
|
+
* IT DECIDES A PROMOTION ONLY UNDER A POLICY THAT READS BENCHMARKS. The
|
|
3529
|
+
* paired comparison applies the judge to both sides of one conversation in
|
|
3530
|
+
* one pass, so most of the judge's variance cancels in its delta; an absolute
|
|
3531
|
+
* mean carries that variance whole. Under the default `holdout` policy a
|
|
3532
|
+
* replay is the number, the difference against what serves today on the same
|
|
3533
|
+
* set, and the history, and a person reads the trend. Under `all`, `primary`,
|
|
3534
|
+
* `k_of_n` or `weighted` the policy reads this replay's delta.
|
|
3535
|
+
*
|
|
3536
|
+
* Every conversation behind it, both answers and the judge's reasons, is
|
|
3537
|
+
* `listBenchmarkRunItems`.
|
|
3359
3538
|
*/
|
|
3360
3539
|
export interface BenchmarkRun {
|
|
3361
3540
|
id: string;
|
|
@@ -3375,6 +3554,27 @@ export interface BenchmarkRun {
|
|
|
3375
3554
|
incumbent_score: number | null;
|
|
3376
3555
|
score_delta: number | null;
|
|
3377
3556
|
per_dimension: BenchmarkDimensionScore[];
|
|
3557
|
+
/**
|
|
3558
|
+
* An answer PASSED (score 0.70 or more) when the judge scored it at least
|
|
3559
|
+
* `pass_threshold`. `*_passed` counts the conversations each side passed
|
|
3560
|
+
* and `*_pass_rate` is that count over `rows_scored`: null unless `status`
|
|
3561
|
+
* is `done`, like the scores.
|
|
3562
|
+
*/
|
|
3563
|
+
pass_threshold: number;
|
|
3564
|
+
incumbent_passed: number | null;
|
|
3565
|
+
candidate_passed: number | null;
|
|
3566
|
+
incumbent_pass_rate: number | null;
|
|
3567
|
+
candidate_pass_rate: number | null;
|
|
3568
|
+
/**
|
|
3569
|
+
* Conversations the attempt scored higher on (`wins`), lower on (`losses`),
|
|
3570
|
+
* or about the same on (`ties`) as the serving version, by the tie band
|
|
3571
|
+
* promotion uses: 0.02 or more above counts as higher; less than 0.02 apart
|
|
3572
|
+
* is about the same.
|
|
3573
|
+
* Null unless `status` is `done`.
|
|
3574
|
+
*/
|
|
3575
|
+
wins: number | null;
|
|
3576
|
+
losses: number | null;
|
|
3577
|
+
ties: number | null;
|
|
3378
3578
|
prompt_tokens: number;
|
|
3379
3579
|
completion_tokens: number;
|
|
3380
3580
|
spent_cents: number;
|
|
@@ -3406,11 +3606,71 @@ export interface BenchmarkHistoryPoint {
|
|
|
3406
3606
|
candidate_score: number | null;
|
|
3407
3607
|
incumbent_score: number | null;
|
|
3408
3608
|
score_delta: number | null;
|
|
3609
|
+
/** The share each side passed (score 0.70 or more); null when the replay has no score. */
|
|
3610
|
+
incumbent_pass_rate: number | null;
|
|
3611
|
+
candidate_pass_rate: number | null;
|
|
3409
3612
|
checkpoint_id: string | null;
|
|
3410
3613
|
decision: TrainingDecision | null;
|
|
3411
3614
|
status: BenchmarkRunStatus;
|
|
3412
3615
|
status_reason: string | null;
|
|
3413
3616
|
}
|
|
3617
|
+
/**
|
|
3618
|
+
* One model's answer to one pinned conversation in a replay -- its text and
|
|
3619
|
+
* the tool calls it made (null when none, and on a replay scored before they
|
|
3620
|
+
* were kept) -- and its score. On an exact benchmark `judge` is the exact
|
|
3621
|
+
* check's verdict.
|
|
3622
|
+
*/
|
|
3623
|
+
export interface BenchmarkRunItemSide {
|
|
3624
|
+
completion: string | null;
|
|
3625
|
+
tool_calls: TrainingToolCall[] | null;
|
|
3626
|
+
judge: EvaluationItemJudge | null;
|
|
3627
|
+
score: number | null;
|
|
3628
|
+
/** True when it passed (score 0.70 or more); null when it has no score. */
|
|
3629
|
+
passed: boolean | null;
|
|
3630
|
+
}
|
|
3631
|
+
/**
|
|
3632
|
+
* One pinned conversation of one replay: the prompt, both answers, what the
|
|
3633
|
+
* judge made of each, and which side won it.
|
|
3634
|
+
*
|
|
3635
|
+
* `winner` compares the two scores by the tie band promotion uses: the side
|
|
3636
|
+
* scoring 0.02 or more above the other, `tie` when they are less than 0.02
|
|
3637
|
+
* apart, and null until both are scored.
|
|
3638
|
+
* `source_trace_id` goes null once the conversation it was pinned from is
|
|
3639
|
+
* deleted; the pinned copy stays.
|
|
3640
|
+
*/
|
|
3641
|
+
export interface BenchmarkRunItem {
|
|
3642
|
+
id: number;
|
|
3643
|
+
benchmark_item_id: number;
|
|
3644
|
+
ordinal: number;
|
|
3645
|
+
source_trace_id: string | null;
|
|
3646
|
+
source_trace_url: string | null;
|
|
3647
|
+
prompt: TrainingMessage[];
|
|
3648
|
+
tools: unknown[] | null;
|
|
3649
|
+
reference: EvaluationReference | null;
|
|
3650
|
+
incumbent: BenchmarkRunItemSide;
|
|
3651
|
+
candidate: BenchmarkRunItemSide;
|
|
3652
|
+
winner: EvaluationWinner | null;
|
|
3653
|
+
status: EvaluationItemStatus;
|
|
3654
|
+
error: string | null;
|
|
3655
|
+
/** Why the row failed; null unless it failed, and on a row failed before causes were kept. */
|
|
3656
|
+
error_code: ItemErrorCode | null;
|
|
3657
|
+
}
|
|
3658
|
+
/**
|
|
3659
|
+
* Which conversations of a replay to read: the filters a report's items take,
|
|
3660
|
+
* but `orders` -- a replay has no side-by-side reading.
|
|
3661
|
+
*/
|
|
3662
|
+
export interface BenchmarkRunItemListParams {
|
|
3663
|
+
winner?: EvaluationItemWinnerFilter;
|
|
3664
|
+
candidate_passed?: boolean;
|
|
3665
|
+
incumbent_passed?: boolean;
|
|
3666
|
+
has_reference?: boolean;
|
|
3667
|
+
status?: ReportStatusFilter;
|
|
3668
|
+
sort?: ReportSort;
|
|
3669
|
+
q?: string;
|
|
3670
|
+
/** 50 when absent; at most 200. */
|
|
3671
|
+
limit?: number;
|
|
3672
|
+
offset?: number;
|
|
3673
|
+
}
|
|
3414
3674
|
/**
|
|
3415
3675
|
* Where the conversations are copied FROM. Read once, at creation, never again.
|
|
3416
3676
|
* A benchmark pins conversations by id; to make one from a file, import it
|
|
@@ -3424,20 +3684,30 @@ export interface BenchmarkSource {
|
|
|
3424
3684
|
/**
|
|
3425
3685
|
* The pin: 20 to 200 conversations, and a judge with a rubric to measure them.
|
|
3426
3686
|
*
|
|
3427
|
-
* A conversation with nothing to ask a model
|
|
3687
|
+
* A conversation with nothing to ask a model, or too large to keep in
|
|
3688
|
+
* storage, is refused (422 `BENCHMARK_ROW_UNUSABLE`) rather than skipped.
|
|
3428
3689
|
* Pinning 47 of the 50 somebody chose is the set being wrong from the first
|
|
3429
3690
|
* day, and they would never find out.
|
|
3430
3691
|
*/
|
|
3431
3692
|
/**
|
|
3432
|
-
* A name and
|
|
3433
|
-
* and the model it scores on, gives both models
|
|
3434
|
-
* length, and sets what one replay may spend;
|
|
3435
|
-
* service refuses `judge_id`, `judge_model`,
|
|
3436
|
-
* `per_run_ceiling_cents` by name).
|
|
3693
|
+
* A name, the conversations and how they are scored, nothing else. The
|
|
3694
|
+
* platform freezes the judge and the model it scores on, gives both models
|
|
3695
|
+
* the comparison's own answer length, and sets what one replay may spend;
|
|
3696
|
+
* none of that is sent (the service refuses `judge_id`, `judge_model`,
|
|
3697
|
+
* `max_tokens` and `per_run_ceiling_cents` by name).
|
|
3698
|
+
*
|
|
3699
|
+
* `check` is `judge` when absent. An `exact` benchmark needs a right answer
|
|
3700
|
+
* on every conversation: one without is refused 422
|
|
3701
|
+
* `BENCHMARK_ROW_HAS_NO_ANSWER`, naming it, and nothing is saved. One with
|
|
3702
|
+
* nothing to ask a model, or too large to keep in storage, is refused 422
|
|
3703
|
+
* `BENCHMARK_ROW_UNUSABLE`, naming it; and when the conversations cannot be
|
|
3704
|
+
* stored just then the create is refused 409 `CONFLICT` with nothing saved
|
|
3705
|
+
* (try again in a minute).
|
|
3437
3706
|
*/
|
|
3438
3707
|
export interface BenchmarkCreateParams {
|
|
3439
3708
|
name: string;
|
|
3440
3709
|
source: BenchmarkSource;
|
|
3710
|
+
check?: BenchmarkCheck;
|
|
3441
3711
|
}
|
|
3442
3712
|
export interface BenchmarkListParams {
|
|
3443
3713
|
status?: BenchmarkStatus;
|
|
@@ -3506,6 +3776,10 @@ export type TrainingRuleRunRefusalCode = 'NOT_ENOUGH_SAMPLES' | 'PIPELINE_NEEDS_
|
|
|
3506
3776
|
* body (400, which names the field). The SDK's tests read them off the
|
|
3507
3777
|
* service. Nothing is saved when any of them is answered.
|
|
3508
3778
|
*
|
|
3779
|
+
* A `train_when.min_samples` is one of those 400s: the sample minimums are
|
|
3780
|
+
* fixed by the platform (`listModels` returns them as `floors`) and no body
|
|
3781
|
+
* sets them.
|
|
3782
|
+
*
|
|
3509
3783
|
* The name and tags:
|
|
3510
3784
|
* - `PIPELINE_NAME_TAKEN` (409): another pipeline in the workspace has the
|
|
3511
3785
|
* name, a deleted one included. Choose another name.
|
|
@@ -3514,17 +3788,20 @@ export type TrainingRuleRunRefusalCode = 'NOT_ENOUGH_SAMPLES' | 'PIPELINE_NEEDS_
|
|
|
3514
3788
|
*
|
|
3515
3789
|
* An edit only:
|
|
3516
3790
|
* - `REVISION_MISMATCH` (409): `expected_revision` is not the pipeline's
|
|
3517
|
-
* revision any more
|
|
3791
|
+
* revision any more, or the pipeline changed while the edit was being saved
|
|
3792
|
+
* (a version went live, which can change its models). Nothing was saved.
|
|
3793
|
+
* Read it again and resend.
|
|
3518
3794
|
* - `RUN_ACTIVE` (409): the model cannot change while an attempt is running.
|
|
3519
3795
|
* - `NOT_A_SIMPLE_PIPELINE` (409): a tag, use case or challenger edit on a
|
|
3520
3796
|
* pipeline created before pipelines had them; its other settings can
|
|
3521
3797
|
* still change.
|
|
3522
3798
|
*
|
|
3523
|
-
* The model and
|
|
3799
|
+
* The model and how it is promoted:
|
|
3524
3800
|
* - `MODEL_NOT_TRAINABLE` (422): `model.id` or `challenger_model.id` is not a
|
|
3525
|
-
* model `listModels` offers, or the challenger is the model itself.
|
|
3526
|
-
*
|
|
3527
|
-
*
|
|
3801
|
+
* model `listModels` offers, or the challenger is the model itself. On an
|
|
3802
|
+
* edit only a changed id is checked against the list: an id equal to the
|
|
3803
|
+
* pipeline's current one (ignoring case) is kept, and whether it can still
|
|
3804
|
+
* be trained is checked when an attempt starts.
|
|
3528
3805
|
* - `NO_GPU_FITS` (422): no machines can train or serve the model right now.
|
|
3529
3806
|
* - `MODEL_REVISION_UNAVAILABLE` (422): the model could not be pinned to an
|
|
3530
3807
|
* exact revision because the training service did not answer. Try again
|
|
@@ -3552,7 +3829,7 @@ export type TrainingRuleRunRefusalCode = 'NOT_ENOUGH_SAMPLES' | 'PIPELINE_NEEDS_
|
|
|
3552
3829
|
* the key every comparison is scored with) did not answer just then. Try
|
|
3553
3830
|
* again in a minute.
|
|
3554
3831
|
*/
|
|
3555
|
-
export type TrainingRuleSaveRefusalCode = 'PIPELINE_NAME_TAKEN' | 'OWN_TAG_TAKEN' | 'REVISION_MISMATCH' | 'RUN_ACTIVE' | 'NOT_A_SIMPLE_PIPELINE' | 'MODEL_NOT_TRAINABLE' | '
|
|
3832
|
+
export type TrainingRuleSaveRefusalCode = 'PIPELINE_NAME_TAKEN' | 'OWN_TAG_TAKEN' | 'REVISION_MISMATCH' | 'RUN_ACTIVE' | 'NOT_A_SIMPLE_PIPELINE' | 'MODEL_NOT_TRAINABLE' | 'NO_GPU_FITS' | 'MODEL_REVISION_UNAVAILABLE' | 'NO_JUDGE_MODEL' | 'PROMOTION_POLICY_UNKNOWN' | 'PROMOTION_K_REQUIRED' | 'PROMOTION_K_UNREACHABLE' | 'PROMOTION_POLICY_NEEDS_BENCHMARK' | 'TRAINING_NOT_ENABLED' | 'METHOD_NOT_ENABLED' | 'CEILING_TOO_LOW' | 'MODELS_UNAVAILABLE' | 'GPU_OPTIONS_UNAVAILABLE' | 'AGENT_COULD_NOT_START';
|
|
3556
3833
|
/**
|
|
3557
3834
|
* The body of a manual run refused `409 MONTHLY_LIMIT_REACHED`, as
|
|
3558
3835
|
* `ApiError.body` carries it.
|
|
@@ -3671,6 +3948,9 @@ export interface PipelineVersion {
|
|
|
3671
3948
|
rows_scored: number | null;
|
|
3672
3949
|
win_rate: number | null;
|
|
3673
3950
|
mean_delta: number | null;
|
|
3951
|
+
/** The share of those conversations each side passed (score 0.70 or more). */
|
|
3952
|
+
candidate_pass_rate: number | null;
|
|
3953
|
+
incumbent_pass_rate: number | null;
|
|
3674
3954
|
/**
|
|
3675
3955
|
* The standing benchmark's replay of this version, when the rule has one.
|
|
3676
3956
|
* Only scores with `benchmark_comparable` sit on one axis.
|
|
@@ -3746,6 +4026,14 @@ export interface PipelineAttempt {
|
|
|
3746
4026
|
base_model_id: string | null;
|
|
3747
4027
|
model_family: string | null;
|
|
3748
4028
|
outcome: PipelineAttemptOutcome;
|
|
4029
|
+
/**
|
|
4030
|
+
* What was decided about it once it was compared; null while nothing has
|
|
4031
|
+
* been. A member's rejection is `rejected` where the outcome says `stopped`.
|
|
4032
|
+
*/
|
|
4033
|
+
decision: TrainingDecision | null;
|
|
4034
|
+
/** The samples its set trained on and held back; null until its set was built. */
|
|
4035
|
+
train_rows: number | null;
|
|
4036
|
+
holdout_rows: number | null;
|
|
3749
4037
|
/** The version it became, when it became one. */
|
|
3750
4038
|
version: number | null;
|
|
3751
4039
|
created_at: string;
|
|
@@ -3757,6 +4045,12 @@ export interface PipelineAttempt {
|
|
|
3757
4045
|
cost_up_to: boolean;
|
|
3758
4046
|
verdict: TrainingVerdict | null;
|
|
3759
4047
|
win_rate: number | null;
|
|
4048
|
+
/**
|
|
4049
|
+
* The share of the held-back conversations the attempt and the version it
|
|
4050
|
+
* was compared with passed (score 0.70 or more); null until it is compared.
|
|
4051
|
+
*/
|
|
4052
|
+
candidate_pass_rate: number | null;
|
|
4053
|
+
incumbent_pass_rate: number | null;
|
|
3760
4054
|
evaluation_id: string | null;
|
|
3761
4055
|
/** Its last sentence. */
|
|
3762
4056
|
reason: string | null;
|
|
@@ -3783,22 +4077,52 @@ export interface PipelineSchedule {
|
|
|
3783
4077
|
hour_utc: number;
|
|
3784
4078
|
}
|
|
3785
4079
|
/**
|
|
3786
|
-
* When a pipeline trains:
|
|
3787
|
-
*
|
|
3788
|
-
* is
|
|
4080
|
+
* When a pipeline trains: once it has the samples the platform's fixed
|
|
4081
|
+
* minimum asks for (`minimums` says how many, and how many it has) AND, when
|
|
4082
|
+
* there is a schedule, at its scheduled slot. A null schedule trains as soon
|
|
4083
|
+
* as the minimum is met. The minimum is not a setting: no body sets it.
|
|
3789
4084
|
*/
|
|
3790
4085
|
export interface PipelineTrainWhen {
|
|
3791
|
-
min_samples: number;
|
|
3792
4086
|
schedule: PipelineSchedule | null;
|
|
3793
4087
|
}
|
|
3794
|
-
/**
|
|
4088
|
+
/**
|
|
4089
|
+
* What is held back to judge each attempt by, and never trained on:
|
|
4090
|
+
* max(`min_rows`, `percent`% of the pipeline's samples). The set is sticky:
|
|
4091
|
+
* lowering the percent releases no sample already held back, and raising it
|
|
4092
|
+
* holds back only samples no attempt trained on.
|
|
4093
|
+
*/
|
|
3795
4094
|
export interface PipelineHoldout {
|
|
4095
|
+
/** The pipeline's share, 5 to 20 (5 unless a member chose more); set with `holdout.percent`. */
|
|
4096
|
+
percent: number;
|
|
4097
|
+
/** The floor, 100, held back whatever the share says. */
|
|
3796
4098
|
min_rows: number;
|
|
4099
|
+
/** How many samples it holds back today (= `holdout_size`). Detail only; null on the list. */
|
|
4100
|
+
rows: number | null;
|
|
4101
|
+
/**
|
|
4102
|
+
* How many of `rows` are held back because an earlier run of the pipeline
|
|
4103
|
+
* held them back: they stay held back whatever became of that run and
|
|
4104
|
+
* whatever the share says; the rest are the share's. Before the first
|
|
4105
|
+
* version it is what raises `minimums.needed` above the share's own (these
|
|
4106
|
+
* rows plus the 1,000 to train on). Detail only; null on the list.
|
|
4107
|
+
*/
|
|
4108
|
+
held_before: number | null;
|
|
3797
4109
|
}
|
|
3798
4110
|
/**
|
|
3799
|
-
* How far the data is from the next
|
|
3800
|
-
*
|
|
3801
|
-
*
|
|
4111
|
+
* How far the data is from the next attempt, by the platform's fixed
|
|
4112
|
+
* minimums (`floors` on `listModels`). READ-ONLY: no body changes them.
|
|
4113
|
+
*
|
|
4114
|
+
* `first_version`: `needed` usable samples the first attempt needs -- the
|
|
4115
|
+
* rows it trains on plus the ones held back to judge it. `new_rows`: `needed`
|
|
4116
|
+
* usable samples the last trained attempt did not have, which is
|
|
4117
|
+
* `floors.new_samples` or `floors.new_samples_percent` of the rows that
|
|
4118
|
+
* attempt trained on, whichever is more. `have`, `short` and `message` are
|
|
4119
|
+
* measured on the detail only. There, after an attempt has trained, `short`
|
|
4120
|
+
* is how many more new samples have to arrive: new samples fill the held-back
|
|
4121
|
+
* set first, so after the held-back share is raised it can be more than
|
|
4122
|
+
* `needed` - `have`; and `have` is the new samples the next attempt would
|
|
4123
|
+
* train on, or the samples since that attempt when that count is what it
|
|
4124
|
+
* waits for. Train now's 422 NOT_ENOUGH_SAMPLES carries the same `have` and
|
|
4125
|
+
* `need`.
|
|
3802
4126
|
*/
|
|
3803
4127
|
export interface PipelineMinimums {
|
|
3804
4128
|
basis: 'first_version' | 'new_rows';
|
|
@@ -3807,6 +4131,22 @@ export interface PipelineMinimums {
|
|
|
3807
4131
|
short: number | null;
|
|
3808
4132
|
message: string | null;
|
|
3809
4133
|
}
|
|
4134
|
+
/**
|
|
4135
|
+
* The state of the live version's deployment:
|
|
4136
|
+
* - `serving`: it answers.
|
|
4137
|
+
* - `starting`: it is on its way up.
|
|
4138
|
+
* - `stopped`, `paused_for_funds` (the wallet ran out) and `deleted`: it does
|
|
4139
|
+
* not answer and is not billed.
|
|
4140
|
+
* - `paused_by_platform`: the platform paused it because billing could not be
|
|
4141
|
+
* reached; it does not answer.
|
|
4142
|
+
* - `failed`: it does not answer.
|
|
4143
|
+
*/
|
|
4144
|
+
export type PipelineLiveDeploymentStatus = 'serving' | 'starting' | 'stopped' | 'paused_for_funds' | 'paused_by_platform' | 'failed' | 'deleted';
|
|
4145
|
+
/** The live version's deployment, as last checked (`checked_at`). */
|
|
4146
|
+
export interface PipelineLiveDeployment {
|
|
4147
|
+
status: PipelineLiveDeploymentStatus;
|
|
4148
|
+
checked_at: string;
|
|
4149
|
+
}
|
|
3810
4150
|
export interface Pipeline {
|
|
3811
4151
|
rule_id: string;
|
|
3812
4152
|
rule_name: string;
|
|
@@ -3825,8 +4165,9 @@ export interface Pipeline {
|
|
|
3825
4165
|
tags: string[];
|
|
3826
4166
|
/**
|
|
3827
4167
|
* A second base model trained on the same data after each attempt; it
|
|
3828
|
-
* becomes the next version only if it beats the live one
|
|
3829
|
-
*
|
|
4168
|
+
* becomes the next version only if it beats the live one, and then it
|
|
4169
|
+
* becomes the pipeline's model (`base_model_id`) while the model it replaced
|
|
4170
|
+
* becomes this one. `revision` is the commit the server pinned.
|
|
3830
4171
|
*/
|
|
3831
4172
|
challenger_model: PipelineModelRef | null;
|
|
3832
4173
|
train_when: PipelineTrainWhen;
|
|
@@ -3842,6 +4183,14 @@ export interface Pipeline {
|
|
|
3842
4183
|
live_version: number | null;
|
|
3843
4184
|
/** The same number under its older name. */
|
|
3844
4185
|
champion_version: number | null;
|
|
4186
|
+
/**
|
|
4187
|
+
* Whether the deployment the live version answers from is up, as the
|
|
4188
|
+
* platform last checked it. Null when there is no live version, when what
|
|
4189
|
+
* serves is not a deployment, or before the first check of that deployment.
|
|
4190
|
+
*/
|
|
4191
|
+
live_deployment: PipelineLiveDeployment | null;
|
|
4192
|
+
/** What the pipeline's history takes up in storage. */
|
|
4193
|
+
storage: LoopStorage;
|
|
3845
4194
|
/** The name the app calls. It does not change when a version is promoted. */
|
|
3846
4195
|
serving_name: string;
|
|
3847
4196
|
/**
|
|
@@ -3903,10 +4252,10 @@ export interface TrainingRuleDeleteResponse {
|
|
|
3903
4252
|
deleted: boolean;
|
|
3904
4253
|
rule_id: string;
|
|
3905
4254
|
/**
|
|
3906
|
-
* The name this delete just spent. The
|
|
3907
|
-
*
|
|
3908
|
-
*
|
|
3909
|
-
*
|
|
4255
|
+
* The name this delete just spent. The pipeline's history is purged in the
|
|
4256
|
+
* background, but its record keeps the name after it has left every list
|
|
4257
|
+
* you can read, so no later pipeline in the workspace can be called that.
|
|
4258
|
+
* There is no undelete.
|
|
3910
4259
|
*/
|
|
3911
4260
|
retained_name: string;
|
|
3912
4261
|
cancelled_run_id: string | null;
|
|
@@ -3915,6 +4264,14 @@ export interface TrainingRunListResponse {
|
|
|
3915
4264
|
runs: TrainingRunSummary[];
|
|
3916
4265
|
total: number;
|
|
3917
4266
|
}
|
|
4267
|
+
/** One replay of a run on one of its pipeline's benchmarks, to link its report by. */
|
|
4268
|
+
export interface TrainingRunBenchmarkRun {
|
|
4269
|
+
benchmark_id: string;
|
|
4270
|
+
name: string;
|
|
4271
|
+
/** The replay's id: what `getBenchmarkRun` and `listBenchmarkRunItems` take. */
|
|
4272
|
+
run_id: string;
|
|
4273
|
+
status: BenchmarkRunStatus;
|
|
4274
|
+
}
|
|
3918
4275
|
export interface TrainingRunResponse {
|
|
3919
4276
|
run: TrainingRun;
|
|
3920
4277
|
timeline: TrainingRunEvent[];
|
|
@@ -3924,8 +4281,84 @@ export interface TrainingRunResponse {
|
|
|
3924
4281
|
* attached to the rule.
|
|
3925
4282
|
*/
|
|
3926
4283
|
benchmark: BenchmarkRun | null;
|
|
4284
|
+
/** Every benchmark this run was replayed on, the primary included. */
|
|
4285
|
+
benchmark_runs: TrainingRunBenchmarkRun[];
|
|
3927
4286
|
links: TrainingRunLinks;
|
|
3928
4287
|
available_actions: TrainingRunActions;
|
|
4288
|
+
/** What became of the attempt and why, measurement by measurement. */
|
|
4289
|
+
promotion: TrainingRunPromotion;
|
|
4290
|
+
/**
|
|
4291
|
+
* Every bar the held-back verdict applied, with what it needed, what it got
|
|
4292
|
+
* and whether it was met: the rule itself, which the verdict is read off.
|
|
4293
|
+
* Null until the comparison is finished, when no thresholds were recorded,
|
|
4294
|
+
* and for a report decided under an earlier rule that this list would read
|
|
4295
|
+
* differently from its verdict (`verdict_checks_withheld` says so).
|
|
4296
|
+
*/
|
|
4297
|
+
verdict_checks: VerdictCheck[] | null;
|
|
4298
|
+
/**
|
|
4299
|
+
* Why a finished report's `verdict_checks` is null although its thresholds
|
|
4300
|
+
* were recorded: `decided_under_earlier_rule` when an earlier version of
|
|
4301
|
+
* the rule decided it, so today's bars would not explain its verdict. Null
|
|
4302
|
+
* for every other null (not finished, no thresholds recorded) and when the
|
|
4303
|
+
* list is shown. Never rebuild the bars from today's rule for such a report.
|
|
4304
|
+
*/
|
|
4305
|
+
verdict_checks_withheld: VerdictChecksWithheld | null;
|
|
4306
|
+
/** What the attempt has cost, part by part, from the charges recorded on it. */
|
|
4307
|
+
cost: TrainingRunCost;
|
|
4308
|
+
}
|
|
4309
|
+
/** Why a run detail's `verdict_checks` is withheld. */
|
|
4310
|
+
export type VerdictChecksWithheld = 'decided_under_earlier_rule';
|
|
4311
|
+
/**
|
|
4312
|
+
* What became of an attempt and why. `decision` is what was done, and who
|
|
4313
|
+
* did it: `rejected` is a member choosing not to publish it, beside a
|
|
4314
|
+
* `verdict` that may say `better`; `auto_rejected` is the pipeline's rule
|
|
4315
|
+
* turning it down; `expired` is nobody deciding before the review deadline,
|
|
4316
|
+
* with `outcome` `stopped` when it was better. `policy` to `measurements` are the promotion rule's record, null
|
|
4317
|
+
* (and `[]`) when it recorded none: an attempt still being compared, one that
|
|
4318
|
+
* ended before it was, or one decided before the record was kept.
|
|
4319
|
+
*/
|
|
4320
|
+
export interface TrainingRunPromotion {
|
|
4321
|
+
/** As the pipeline's attempts list says it (`PipelineAttempt.outcome`). */
|
|
4322
|
+
outcome: PipelineAttemptOutcome;
|
|
4323
|
+
decision: TrainingDecision | null;
|
|
4324
|
+
policy: string | null;
|
|
4325
|
+
k: number | null;
|
|
4326
|
+
verdict: string | null;
|
|
4327
|
+
reason: string | null;
|
|
4328
|
+
weighted_delta: number | null;
|
|
4329
|
+
/** The held-back comparison first, then each benchmark, each with its outcome and reason. */
|
|
4330
|
+
measurements: PromotionMeasurement[];
|
|
4331
|
+
}
|
|
4332
|
+
/** The bars a held-back verdict applies. */
|
|
4333
|
+
export type VerdictCheckKey = 'rows_scored' | 'failures' | 'rubric' | 'mean_change' | 'win_rate' | 'beyond_chance';
|
|
4334
|
+
/**
|
|
4335
|
+
* One bar of the held-back verdict. `needed` and `got` are on the bar's own
|
|
4336
|
+
* scale -- conversations for `rows_scored` (at least) and `failures` (at
|
|
4337
|
+
* most), the score change for `mean_change` (at least), a share for
|
|
4338
|
+
* `win_rate` (at least), a probability for `beyond_chance` (at most) -- and
|
|
4339
|
+
* null where the bar has no number (`rubric`) or nothing produced one.
|
|
4340
|
+
*/
|
|
4341
|
+
export interface VerdictCheck {
|
|
4342
|
+
key: VerdictCheckKey;
|
|
4343
|
+
/** The bar in plain words, its direction included. */
|
|
4344
|
+
label: string;
|
|
4345
|
+
needed: number | null;
|
|
4346
|
+
got: number | null;
|
|
4347
|
+
met: boolean;
|
|
4348
|
+
}
|
|
4349
|
+
/**
|
|
4350
|
+
* An attempt's cost in cents, part by part. `total_cents` is the attempt's
|
|
4351
|
+
* `cost_cents` on the pipeline. `up_to` says `comparison_cents` (and so the
|
|
4352
|
+
* total) is the most the comparison machines can have cost rather than what
|
|
4353
|
+
* they did; the other three parts are always charges.
|
|
4354
|
+
*/
|
|
4355
|
+
export interface TrainingRunCost {
|
|
4356
|
+
training_cents: number;
|
|
4357
|
+
comparison_cents: number;
|
|
4358
|
+
scoring_cents: number;
|
|
4359
|
+
benchmark_cents: number;
|
|
4360
|
+
total_cents: number;
|
|
4361
|
+
up_to: boolean;
|
|
3929
4362
|
}
|
|
3930
4363
|
export interface TrainingRunActionResponse {
|
|
3931
4364
|
run: TrainingRun;
|
|
@@ -3935,6 +4368,16 @@ export interface TrainingRunActionResponse {
|
|
|
3935
4368
|
export interface EvaluationItemsResponse {
|
|
3936
4369
|
items: EvaluationItem[];
|
|
3937
4370
|
total: number;
|
|
4371
|
+
/** How many rows a `q` search read and searched; null without `q`. */
|
|
4372
|
+
searched: number | null;
|
|
4373
|
+
}
|
|
4374
|
+
/** A page of one replay's conversations, in the benchmark's order. */
|
|
4375
|
+
export interface BenchmarkRunItemsResponse {
|
|
4376
|
+
items: BenchmarkRunItem[];
|
|
4377
|
+
/** Every conversation the filter matches, not only this page. */
|
|
4378
|
+
total: number;
|
|
4379
|
+
/** How many rows a `q` search read and searched; null without `q`. */
|
|
4380
|
+
searched: number | null;
|
|
3938
4381
|
}
|
|
3939
4382
|
export interface InferenceAliasListResponse {
|
|
3940
4383
|
aliases: InferenceAlias[];
|
|
@@ -3996,9 +4439,12 @@ export interface PipelineWriteRequest {
|
|
|
3996
4439
|
} | null;
|
|
3997
4440
|
/** More tags whose conversations the pipeline trains on. On an edit the list replaces the old one. */
|
|
3998
4441
|
tags?: string[];
|
|
3999
|
-
/**
|
|
4442
|
+
/**
|
|
4443
|
+
* The schedule to wait for, beside the platform's fixed sample minimum.
|
|
4444
|
+
* There is no `min_samples`: the minimums are fixed, and a body that sends
|
|
4445
|
+
* one is refused 400 naming it.
|
|
4446
|
+
*/
|
|
4000
4447
|
train_when?: {
|
|
4001
|
-
min_samples?: number;
|
|
4002
4448
|
schedule?: {
|
|
4003
4449
|
every: 'day' | 'week';
|
|
4004
4450
|
weekday?: number;
|
|
@@ -4009,6 +4455,21 @@ export interface PipelineWriteRequest {
|
|
|
4009
4455
|
policy: PipelinePromotion['policy'];
|
|
4010
4456
|
k?: number;
|
|
4011
4457
|
};
|
|
4458
|
+
/**
|
|
4459
|
+
* The share of the pipeline's samples held back to judge each attempt and
|
|
4460
|
+
* never trained on: a whole number from 5 to 20 (5 when absent on a
|
|
4461
|
+
* create; unchanged when absent on an edit). At least 100 are held back
|
|
4462
|
+
* whatever it says. Anything else is 400 naming `holdout.percent`, and
|
|
4463
|
+
* null is 400. It does not change what the pipeline may spend and nothing
|
|
4464
|
+
* is asked again: a new share is a new revision, saved at once. But a
|
|
4465
|
+
* larger share means more held-back samples are scored on each attempt (at
|
|
4466
|
+
* most `floors.held_back.scored_rows`), and scoring is paid from the
|
|
4467
|
+
* wallet. Lowering it keeps every sample already held back; raising it
|
|
4468
|
+
* holds back only new samples, which then do not count as new work.
|
|
4469
|
+
*/
|
|
4470
|
+
holdout?: {
|
|
4471
|
+
percent: number;
|
|
4472
|
+
};
|
|
4012
4473
|
/** 1 to 100, or null for no limit (the default). Counts versions, not attempts. */
|
|
4013
4474
|
max_versions?: number | null;
|
|
4014
4475
|
enabled?: boolean;
|
|
@@ -4031,12 +4492,40 @@ export interface LoopModel {
|
|
|
4031
4492
|
/** Verified end to end on the platform for training and serving. */
|
|
4032
4493
|
recommended: boolean;
|
|
4033
4494
|
}
|
|
4034
|
-
/**
|
|
4495
|
+
/**
|
|
4496
|
+
* The fixed minimums a pipeline is held to, in samples
|
|
4497
|
+
* (`GET /api/loop/models`). READ-ONLY: they are the platform's, and no body
|
|
4498
|
+
* sets them.
|
|
4499
|
+
*/
|
|
4035
4500
|
export interface PipelineFloors {
|
|
4036
|
-
/**
|
|
4501
|
+
/**
|
|
4502
|
+
* Samples a new pipeline's first attempt needs at the default held-back
|
|
4503
|
+
* share: the rows it trains on plus the held-back set (a pipeline holding
|
|
4504
|
+
* back more needs more; its own `minimums` says how many).
|
|
4505
|
+
*/
|
|
4037
4506
|
first_version_samples: number;
|
|
4038
|
-
/**
|
|
4507
|
+
/** The fewest new samples any later attempt waits for. */
|
|
4039
4508
|
new_samples: number;
|
|
4509
|
+
/**
|
|
4510
|
+
* The share, in percent, of the rows the last trained attempt trained on
|
|
4511
|
+
* that a later attempt must add when that is more than `new_samples`.
|
|
4512
|
+
*/
|
|
4513
|
+
new_samples_percent: number;
|
|
4514
|
+
/** The held-back rule a pipeline chooses its share within. */
|
|
4515
|
+
held_back: HeldBackFloors;
|
|
4516
|
+
}
|
|
4517
|
+
/**
|
|
4518
|
+
* The held-back rule: a pipeline holds back max(`min_rows`, its percent of its
|
|
4519
|
+
* samples), and chooses the percent from `default_percent` to `max_percent`
|
|
4520
|
+
* (the body's `holdout.percent`). Each attempt is judged on at most
|
|
4521
|
+
* `scored_rows` of them (the same ones every time); a share that holds back
|
|
4522
|
+
* more than that only keeps samples out of training.
|
|
4523
|
+
*/
|
|
4524
|
+
export interface HeldBackFloors {
|
|
4525
|
+
min_rows: number;
|
|
4526
|
+
default_percent: number;
|
|
4527
|
+
max_percent: number;
|
|
4528
|
+
scored_rows: number;
|
|
4040
4529
|
}
|
|
4041
4530
|
export interface LoopModelsResponse {
|
|
4042
4531
|
models: LoopModel[];
|
|
@@ -4057,6 +4546,10 @@ export interface RuleBenchmark {
|
|
|
4057
4546
|
benchmark_status: string;
|
|
4058
4547
|
item_count: number;
|
|
4059
4548
|
items_digest: string;
|
|
4549
|
+
/** How it scores an answer: a scoring model reading its rubric (`judge`) or an exact check against its right answer (`exact`). */
|
|
4550
|
+
check: BenchmarkCheck;
|
|
4551
|
+
/** What its pinned set takes up in storage now: the figure the benchmark itself carries, this workspace's alone. */
|
|
4552
|
+
storage: LoopStorage;
|
|
4060
4553
|
/** False for a benchmark this pipeline stopped using; its history stays. */
|
|
4061
4554
|
attached: boolean;
|
|
4062
4555
|
/** 1 is the primary; null once removed. */
|
|
@@ -4091,6 +4584,8 @@ export interface CompareBenchmark {
|
|
|
4091
4584
|
name: string;
|
|
4092
4585
|
benchmark_status: string;
|
|
4093
4586
|
items_digest: string;
|
|
4587
|
+
/** How it scores an answer: `judge` or `exact`. */
|
|
4588
|
+
check: BenchmarkCheck;
|
|
4094
4589
|
attached: boolean;
|
|
4095
4590
|
priority: number | null;
|
|
4096
4591
|
added_at: string | null;
|
|
@@ -4111,6 +4606,9 @@ export interface VersionBenchmarkScore {
|
|
|
4111
4606
|
items_digest: string | null;
|
|
4112
4607
|
comparable: boolean;
|
|
4113
4608
|
why: string | null;
|
|
4609
|
+
/** The share each side passed (score 0.70 or more); null when there is no score. */
|
|
4610
|
+
incumbent_pass_rate: number | null;
|
|
4611
|
+
candidate_pass_rate: number | null;
|
|
4114
4612
|
}
|
|
4115
4613
|
/** One measurement a promotion rule weighed. */
|
|
4116
4614
|
export interface PromotionMeasurement {
|
|
@@ -4136,6 +4634,15 @@ export interface PromotionOutcome {
|
|
|
4136
4634
|
weighted_delta: number | null;
|
|
4137
4635
|
measurements: PromotionMeasurement[];
|
|
4138
4636
|
}
|
|
4637
|
+
/** A version's head-to-head on the held-back conversations. */
|
|
4638
|
+
export interface VersionHoldout {
|
|
4639
|
+
rows_scored: number | null;
|
|
4640
|
+
win_rate: number | null;
|
|
4641
|
+
mean_delta: number | null;
|
|
4642
|
+
/** The share each side passed (score 0.70 or more). */
|
|
4643
|
+
incumbent_pass_rate: number | null;
|
|
4644
|
+
candidate_pass_rate: number | null;
|
|
4645
|
+
}
|
|
4139
4646
|
/** One version with every measurement it has. */
|
|
4140
4647
|
export interface VersionScores {
|
|
4141
4648
|
version: number;
|
|
@@ -4148,11 +4655,7 @@ export interface VersionScores {
|
|
|
4148
4655
|
verdict: string | null;
|
|
4149
4656
|
decision: string | null;
|
|
4150
4657
|
compared_at: string | null;
|
|
4151
|
-
holdout:
|
|
4152
|
-
rows_scored: number | null;
|
|
4153
|
-
win_rate: number | null;
|
|
4154
|
-
mean_delta: number | null;
|
|
4155
|
-
};
|
|
4658
|
+
holdout: VersionHoldout;
|
|
4156
4659
|
/** One entry per entry of the response's `benchmarks`, in the same order. */
|
|
4157
4660
|
benchmarks: VersionBenchmarkScore[];
|
|
4158
4661
|
promotion: PromotionOutcome | null;
|
|
@@ -4181,6 +4684,165 @@ export interface VersionCompareParams {
|
|
|
4181
4684
|
a?: number;
|
|
4182
4685
|
b?: number;
|
|
4183
4686
|
}
|
|
4687
|
+
/**
|
|
4688
|
+
* b's score against a's on one held-back conversation, by the tie band:
|
|
4689
|
+
* 0.02 or more above counts as higher; less than 0.02 apart is about the same.
|
|
4690
|
+
*/
|
|
4691
|
+
export type AttemptDirection = 'higher' | 'lower' | 'same';
|
|
4692
|
+
/**
|
|
4693
|
+
* One attempt's held-back comparison against what it was compared with on its
|
|
4694
|
+
* day, over ITS OWN held-back set (the set grows between attempts: the
|
|
4695
|
+
* like-for-like figures are `shared_sample.a` and `.b`). Every number is null
|
|
4696
|
+
* until the comparison is finished; two attempts' win rates are never
|
|
4697
|
+
* subtracted, since their opponents differ.
|
|
4698
|
+
*/
|
|
4699
|
+
export interface AttemptHoldout {
|
|
4700
|
+
evaluation_id: string | null;
|
|
4701
|
+
status: EvaluationStatus | null;
|
|
4702
|
+
/** The scoring model its comparison froze when it opened; null for an attempt never compared. */
|
|
4703
|
+
judge_model: string | null;
|
|
4704
|
+
rows_scored: number | null;
|
|
4705
|
+
wins: number | null;
|
|
4706
|
+
losses: number | null;
|
|
4707
|
+
ties: number | null;
|
|
4708
|
+
win_rate: number | null;
|
|
4709
|
+
mean_delta: number | null;
|
|
4710
|
+
incumbent_mean: number | null;
|
|
4711
|
+
candidate_mean: number | null;
|
|
4712
|
+
/** The share each side passed (score 0.70 or more). */
|
|
4713
|
+
incumbent_pass_rate: number | null;
|
|
4714
|
+
candidate_pass_rate: number | null;
|
|
4715
|
+
}
|
|
4716
|
+
/** One side of an attempt comparison. */
|
|
4717
|
+
export interface AttemptCompareSide {
|
|
4718
|
+
run_id: string;
|
|
4719
|
+
attempt: number | null;
|
|
4720
|
+
version: number | null;
|
|
4721
|
+
trigger: PipelineAttemptTrigger;
|
|
4722
|
+
base_model_id: string | null;
|
|
4723
|
+
model_family: string | null;
|
|
4724
|
+
outcome: PipelineAttemptOutcome;
|
|
4725
|
+
verdict: TrainingVerdict | null;
|
|
4726
|
+
decision: TrainingDecision | null;
|
|
4727
|
+
train_rows: number | null;
|
|
4728
|
+
holdout_rows: number | null;
|
|
4729
|
+
finished_at: string | null;
|
|
4730
|
+
holdout: AttemptHoldout;
|
|
4731
|
+
}
|
|
4732
|
+
/**
|
|
4733
|
+
* The held-back conversations both attempts were scored on (`rows`), matched
|
|
4734
|
+
* by the conversation they came from.
|
|
4735
|
+
*
|
|
4736
|
+
* `comparable` says both were scored the same way: the same scoring model and
|
|
4737
|
+
* the same rubric, both recorded. When not, `why` says so, naming both scoring
|
|
4738
|
+
* models, and `higher`, `lower`, `same`, `a` and `b` are null: the two scores
|
|
4739
|
+
* are not on one scale. `answer_changed` counts the conversations whose right
|
|
4740
|
+
* answer a member changed between the two attempts; they have no direction
|
|
4741
|
+
* and are left out of `a` and `b`. `answer_unknown` counts the ones whose
|
|
4742
|
+
* right answer one of the two comparisons did not record which it was (it was
|
|
4743
|
+
* compared before that was kept), so whether both were scored against the same
|
|
4744
|
+
* answer is not known: no direction either, left out of `a` and `b`, and
|
|
4745
|
+
* never counted as changed. When comparable, rows = higher + lower + same +
|
|
4746
|
+
* answer_changed + answer_unknown.
|
|
4747
|
+
*/
|
|
4748
|
+
export interface AttemptSharedSample {
|
|
4749
|
+
rows: number;
|
|
4750
|
+
comparable: boolean;
|
|
4751
|
+
why: string | null;
|
|
4752
|
+
answer_changed: number;
|
|
4753
|
+
answer_unknown: number;
|
|
4754
|
+
higher: number | null;
|
|
4755
|
+
lower: number | null;
|
|
4756
|
+
same: number | null;
|
|
4757
|
+
/**
|
|
4758
|
+
* Each attempt over the same conversations (`rows` less `answer_changed`
|
|
4759
|
+
* and `answer_unknown`):
|
|
4760
|
+
* the like-for-like figures, which may be subtracted. Null when there are
|
|
4761
|
+
* none, when the two were not scored the same way, and while either
|
|
4762
|
+
* comparison is still being scored.
|
|
4763
|
+
*/
|
|
4764
|
+
a: AttemptSharedFigures | null;
|
|
4765
|
+
b: AttemptSharedFigures | null;
|
|
4766
|
+
}
|
|
4767
|
+
/** One attempt over the shared conversations: its mean score and how many passed (score 0.70 or more) of `rows`. */
|
|
4768
|
+
export interface AttemptSharedFigures {
|
|
4769
|
+
rows: number;
|
|
4770
|
+
mean: number;
|
|
4771
|
+
passed: number;
|
|
4772
|
+
pass_rate: number;
|
|
4773
|
+
}
|
|
4774
|
+
/** One attempt's replay of a benchmark. `score` and `pass_rate` are null unless it published a score. */
|
|
4775
|
+
export interface AttemptBenchmarkSide {
|
|
4776
|
+
benchmark_run_id: string;
|
|
4777
|
+
status: BenchmarkRunStatus;
|
|
4778
|
+
rows_scored: number;
|
|
4779
|
+
rows_total: number;
|
|
4780
|
+
score: number | null;
|
|
4781
|
+
pass_rate: number | null;
|
|
4782
|
+
}
|
|
4783
|
+
/**
|
|
4784
|
+
* A benchmark both attempts replayed. `delta` is b minus a, null unless
|
|
4785
|
+
* `comparable` (both scored on the same revision of it, every conversation);
|
|
4786
|
+
* `why` says why not.
|
|
4787
|
+
*/
|
|
4788
|
+
export interface AttemptCompareBenchmark {
|
|
4789
|
+
benchmark_id: string;
|
|
4790
|
+
name: string;
|
|
4791
|
+
/** How it scores an answer: a rubric (`judge`) or an exact check (`exact`). */
|
|
4792
|
+
check: 'judge' | 'exact';
|
|
4793
|
+
a: AttemptBenchmarkSide;
|
|
4794
|
+
b: AttemptBenchmarkSide;
|
|
4795
|
+
delta: number | null;
|
|
4796
|
+
comparable: boolean;
|
|
4797
|
+
why: string | null;
|
|
4798
|
+
}
|
|
4799
|
+
/**
|
|
4800
|
+
* One attempt's own answer on a shared conversation, as its comparison scored
|
|
4801
|
+
* it. The answer itself is the `evaluation_item_id` row of
|
|
4802
|
+
* `listEvaluationItems(holdout.evaluation_id)`.
|
|
4803
|
+
*/
|
|
4804
|
+
export interface AttemptCompareItemSide {
|
|
4805
|
+
evaluation_item_id: number;
|
|
4806
|
+
score: number;
|
|
4807
|
+
passed: boolean;
|
|
4808
|
+
}
|
|
4809
|
+
/**
|
|
4810
|
+
* One held-back conversation both attempts were scored on. `direction` is null
|
|
4811
|
+
* when the two scores are not on one scale, and `why` then says why (the two
|
|
4812
|
+
* attempts were scored differently, this conversation's right answer
|
|
4813
|
+
* changed between them, or which right answer one of them was scored against
|
|
4814
|
+
* was not recorded); both scores are listed either way.
|
|
4815
|
+
*/
|
|
4816
|
+
export interface AttemptCompareItem {
|
|
4817
|
+
trace_id: string;
|
|
4818
|
+
a: AttemptCompareItemSide;
|
|
4819
|
+
b: AttemptCompareItemSide;
|
|
4820
|
+
direction: AttemptDirection | null;
|
|
4821
|
+
why: string | null;
|
|
4822
|
+
}
|
|
4823
|
+
/** `GET /api/loop/pipelines/{id}/attempts/compare`: numbers and ids only. */
|
|
4824
|
+
export interface AttemptCompareResponse {
|
|
4825
|
+
rule_id: string;
|
|
4826
|
+
a: AttemptCompareSide;
|
|
4827
|
+
b: AttemptCompareSide;
|
|
4828
|
+
/** Closer than this on one conversation is `same`. */
|
|
4829
|
+
tie_band: number;
|
|
4830
|
+
shared_sample: AttemptSharedSample;
|
|
4831
|
+
benchmarks: AttemptCompareBenchmark[];
|
|
4832
|
+
/** One page of the shared sample, in a's order, narrowed by `filter`. */
|
|
4833
|
+
items: AttemptCompareItem[];
|
|
4834
|
+
/** Every conversation the filter matches, not only this page. */
|
|
4835
|
+
total: number;
|
|
4836
|
+
}
|
|
4837
|
+
/** Which two attempts to set side by side, by RUN id, and which page of their shared conversations. */
|
|
4838
|
+
export interface AttemptCompareParams {
|
|
4839
|
+
a: string;
|
|
4840
|
+
b: string;
|
|
4841
|
+
filter?: AttemptDirection;
|
|
4842
|
+
/** 1 to 200; 50 when absent. */
|
|
4843
|
+
limit?: number;
|
|
4844
|
+
offset?: number;
|
|
4845
|
+
}
|
|
4184
4846
|
/**
|
|
4185
4847
|
* `POST /api/loop/pipelines/{id}/import`: the import body, `source` optional.
|
|
4186
4848
|
* `default_feedback: 'good'` records every answered row without a verdict of
|