pareta 2.1.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/index.cjs +43 -41
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +41 -38
- package/dist/index.d.ts +41 -38
- package/dist/index.mjs +43 -41
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -99,13 +99,13 @@ declare class EvalSet extends BaseModel {
|
|
|
99
99
|
get itemCount(): number | null;
|
|
100
100
|
get scoringStrategy(): string | null;
|
|
101
101
|
/** The one-sentence success criterion this set was created with (CB1:
|
|
102
|
-
* DATA +
|
|
103
|
-
get
|
|
102
|
+
* DATA + PROMPT). Required at create. */
|
|
103
|
+
get prompt(): string | null;
|
|
104
104
|
}
|
|
105
105
|
/**
|
|
106
|
-
* One proposed
|
|
107
|
-
* `ProposalResult.proposals`). `warning` is set on
|
|
108
|
-
* the data looks extraction-shaped (judge grading is weaker there).
|
|
106
|
+
* One proposed way to score an uploaded dataset (a row of
|
|
107
|
+
* `ProposalResult.proposals`). `warning` is set on a "custom-eval" proposal
|
|
108
|
+
* when the data looks extraction-shaped (judge grading is weaker there).
|
|
109
109
|
*/
|
|
110
110
|
declare class ContractProposal extends BaseModel {
|
|
111
111
|
get taskId(): string | null;
|
|
@@ -114,10 +114,10 @@ declare class ContractProposal extends BaseModel {
|
|
|
114
114
|
get warning(): string | null;
|
|
115
115
|
}
|
|
116
116
|
/**
|
|
117
|
-
*
|
|
118
|
-
* /v1/eval-sets/propose-contract):
|
|
119
|
-
*
|
|
120
|
-
*
|
|
117
|
+
* Pareta's answer for `evals.proposeContract` (POST
|
|
118
|
+
* /v1/eval-sets/propose-contract): how your data could be scored under your
|
|
119
|
+
* stated prompt. Nothing is persisted — confirm by passing the chosen
|
|
120
|
+
* `taskId` (or letting a task-less `create` use a clean single proposal).
|
|
121
121
|
*/
|
|
122
122
|
declare class ProposalResult extends BaseModel {
|
|
123
123
|
get proposals(): ContractProposal[];
|
|
@@ -125,16 +125,17 @@ declare class ProposalResult extends BaseModel {
|
|
|
125
125
|
get split(): Raw | null;
|
|
126
126
|
get conflict(): Raw | null;
|
|
127
127
|
get closestTask(): string | null;
|
|
128
|
-
get
|
|
128
|
+
get prompt(): string | null;
|
|
129
129
|
get message(): string | null;
|
|
130
|
-
/** True when
|
|
131
|
-
*
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
*
|
|
135
|
-
* `task: "custom-eval"`, never
|
|
130
|
+
/** True when exactly ONE homogeneous SPECIFIC task matched at high/medium
|
|
131
|
+
* confidence with no conflict/split — the case a task-less `create`
|
|
132
|
+
* proceeds with, no human confirming. `custom-eval` (a judge panel grading
|
|
133
|
+
* each answer against your prompt) is EXCLUDED: it is offered only when
|
|
134
|
+
* nothing specific fits, and using it is the user's CHOICE — opt in with
|
|
135
|
+
* `task: "custom-eval"`, never silently. */
|
|
136
136
|
get isClean(): boolean;
|
|
137
|
-
/**
|
|
137
|
+
/** How a task-less `create` would score this set, or null if the result
|
|
138
|
+
* isn't clean (pass `task` yourself). */
|
|
138
139
|
get boundTask(): string | null;
|
|
139
140
|
}
|
|
140
141
|
/**
|
|
@@ -330,16 +331,17 @@ declare class Tasks {
|
|
|
330
331
|
/**
|
|
331
332
|
* `client.evals` — eval sets + runs (bring-your-own-data evaluation).
|
|
332
333
|
*
|
|
333
|
-
* // An eval set is DATA +
|
|
334
|
-
* // OPTIONAL —
|
|
335
|
-
*
|
|
336
|
-
*
|
|
334
|
+
* // An eval set is DATA + PROMPT (v3, breaking): prompt REQUIRED, task
|
|
335
|
+
* // OPTIONAL — Pareta works out how to score the results from your
|
|
336
|
+
* // prompt + the data's shape.
|
|
337
|
+
* await pa.evals.proposeContract({ items: [...], prompt: "…" }); // preview
|
|
338
|
+
* const set = await pa.evals.sets.create({ items: [...], prompt: "…" }); // clean match used automatically
|
|
337
339
|
* await pa.evals.sets.uploadDocument(set.id, file, { idx, fieldName }); // blob tasks
|
|
338
340
|
* const run = await pa.evals.runs.create({ evalSet: set.id, models: [...], wait: true });
|
|
339
|
-
* // or, in one call: runs.create({ items,
|
|
341
|
+
* // or, in one call: runs.create({ items, prompt: "…", models, wait: true })
|
|
340
342
|
*
|
|
341
|
-
* `create` (and the inline `runs.create` sugar) require `
|
|
342
|
-
* `task` they call `proposeContract` and
|
|
343
|
+
* `create` (and the inline `runs.create` sugar) require `prompt`; with no
|
|
344
|
+
* `task` they call `proposeContract` and accept ONLY a clean single
|
|
343
345
|
* high/medium match — a conflict, split, or ambiguity throws with the
|
|
344
346
|
* proposals so you pin `task`.
|
|
345
347
|
*
|
|
@@ -357,21 +359,21 @@ declare class EvalSets {
|
|
|
357
359
|
private readonly client;
|
|
358
360
|
constructor(client: Transport);
|
|
359
361
|
/**
|
|
360
|
-
* Persist an eval set from your rows. `
|
|
361
|
-
* on what the model should do with each item. `task` is OPTIONAL — omit it
|
|
362
|
-
*
|
|
363
|
-
* (
|
|
364
|
-
* `task` to pin one explicitly.
|
|
362
|
+
* Persist an eval set from your rows. `prompt` is REQUIRED (v3): one sentence
|
|
363
|
+
* on what the model should do with each item. `task` is OPTIONAL — omit it
|
|
364
|
+
* and Pareta works out how to score the results from your prompt + the
|
|
365
|
+
* data's shape (a clean single match is used; anything ambiguous throws with
|
|
366
|
+
* the proposals). Pass `task` to pin one explicitly.
|
|
365
367
|
*/
|
|
366
368
|
create(params: {
|
|
367
369
|
items: Array<Record<string, unknown>>;
|
|
368
|
-
|
|
370
|
+
prompt: string;
|
|
369
371
|
task?: string;
|
|
370
372
|
name?: string;
|
|
371
373
|
}): Promise<EvalSet>;
|
|
372
|
-
/** Internal: the
|
|
374
|
+
/** Internal: the propose call `create` uses when no task is pinned. Public on
|
|
373
375
|
* `Evals` as `proposeContract`; kept here so `sets.create` can reach it. */
|
|
374
|
-
proposeContract(items: Array<Record<string, unknown>>,
|
|
376
|
+
proposeContract(items: Array<Record<string, unknown>>, prompt: string): Promise<ProposalResult>;
|
|
375
377
|
list(): Promise<EvalSet[]>;
|
|
376
378
|
retrieve(evalSetId: string): Promise<EvalSet>;
|
|
377
379
|
delete(evalSetId: string): Promise<void>;
|
|
@@ -390,7 +392,7 @@ interface EvalRunCreateParams {
|
|
|
390
392
|
evalSet?: string;
|
|
391
393
|
task?: string;
|
|
392
394
|
items?: Array<Record<string, unknown>>;
|
|
393
|
-
|
|
395
|
+
prompt?: string;
|
|
394
396
|
models: string[];
|
|
395
397
|
frontier?: FrontierSpec;
|
|
396
398
|
name?: string;
|
|
@@ -416,14 +418,15 @@ declare class Evals {
|
|
|
416
418
|
constructor(client: Transport);
|
|
417
419
|
private readonly client;
|
|
418
420
|
/**
|
|
419
|
-
*
|
|
421
|
+
* How would your data be scored under your stated `prompt`? Stateless
|
|
420
422
|
* discovery — nothing is persisted. Returns a ProposalResult (ranked
|
|
421
|
-
* proposals, the
|
|
422
|
-
* calls this under the hood; use it directly to
|
|
423
|
+
* proposals, the task a task-less create would use, conflict/split
|
|
424
|
+
* reporting). `sets.create` calls this under the hood; use it directly to
|
|
425
|
+
* preview the scoring first.
|
|
423
426
|
*/
|
|
424
427
|
proposeContract(params: {
|
|
425
428
|
items: Array<Record<string, unknown>>;
|
|
426
|
-
|
|
429
|
+
prompt: string;
|
|
427
430
|
}): Promise<ProposalResult>;
|
|
428
431
|
/**
|
|
429
432
|
* The frontier (vendor) roster you can evaluate against. With `task`, each is
|
|
@@ -712,7 +715,7 @@ declare class Pareta implements Transport {
|
|
|
712
715
|
stream<T = unknown>(method: string, path: string, opts?: StreamOptions): AsyncGenerator<T>;
|
|
713
716
|
}
|
|
714
717
|
|
|
715
|
-
declare const VERSION = "
|
|
718
|
+
declare const VERSION = "3.0.0";
|
|
716
719
|
|
|
717
720
|
/**
|
|
718
721
|
* Typed error hierarchy for the Pareta SDK — a faithful port of the Python
|
package/dist/index.d.ts
CHANGED
|
@@ -99,13 +99,13 @@ declare class EvalSet extends BaseModel {
|
|
|
99
99
|
get itemCount(): number | null;
|
|
100
100
|
get scoringStrategy(): string | null;
|
|
101
101
|
/** The one-sentence success criterion this set was created with (CB1:
|
|
102
|
-
* DATA +
|
|
103
|
-
get
|
|
102
|
+
* DATA + PROMPT). Required at create. */
|
|
103
|
+
get prompt(): string | null;
|
|
104
104
|
}
|
|
105
105
|
/**
|
|
106
|
-
* One proposed
|
|
107
|
-
* `ProposalResult.proposals`). `warning` is set on
|
|
108
|
-
* the data looks extraction-shaped (judge grading is weaker there).
|
|
106
|
+
* One proposed way to score an uploaded dataset (a row of
|
|
107
|
+
* `ProposalResult.proposals`). `warning` is set on a "custom-eval" proposal
|
|
108
|
+
* when the data looks extraction-shaped (judge grading is weaker there).
|
|
109
109
|
*/
|
|
110
110
|
declare class ContractProposal extends BaseModel {
|
|
111
111
|
get taskId(): string | null;
|
|
@@ -114,10 +114,10 @@ declare class ContractProposal extends BaseModel {
|
|
|
114
114
|
get warning(): string | null;
|
|
115
115
|
}
|
|
116
116
|
/**
|
|
117
|
-
*
|
|
118
|
-
* /v1/eval-sets/propose-contract):
|
|
119
|
-
*
|
|
120
|
-
*
|
|
117
|
+
* Pareta's answer for `evals.proposeContract` (POST
|
|
118
|
+
* /v1/eval-sets/propose-contract): how your data could be scored under your
|
|
119
|
+
* stated prompt. Nothing is persisted — confirm by passing the chosen
|
|
120
|
+
* `taskId` (or letting a task-less `create` use a clean single proposal).
|
|
121
121
|
*/
|
|
122
122
|
declare class ProposalResult extends BaseModel {
|
|
123
123
|
get proposals(): ContractProposal[];
|
|
@@ -125,16 +125,17 @@ declare class ProposalResult extends BaseModel {
|
|
|
125
125
|
get split(): Raw | null;
|
|
126
126
|
get conflict(): Raw | null;
|
|
127
127
|
get closestTask(): string | null;
|
|
128
|
-
get
|
|
128
|
+
get prompt(): string | null;
|
|
129
129
|
get message(): string | null;
|
|
130
|
-
/** True when
|
|
131
|
-
*
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
*
|
|
135
|
-
* `task: "custom-eval"`, never
|
|
130
|
+
/** True when exactly ONE homogeneous SPECIFIC task matched at high/medium
|
|
131
|
+
* confidence with no conflict/split — the case a task-less `create`
|
|
132
|
+
* proceeds with, no human confirming. `custom-eval` (a judge panel grading
|
|
133
|
+
* each answer against your prompt) is EXCLUDED: it is offered only when
|
|
134
|
+
* nothing specific fits, and using it is the user's CHOICE — opt in with
|
|
135
|
+
* `task: "custom-eval"`, never silently. */
|
|
136
136
|
get isClean(): boolean;
|
|
137
|
-
/**
|
|
137
|
+
/** How a task-less `create` would score this set, or null if the result
|
|
138
|
+
* isn't clean (pass `task` yourself). */
|
|
138
139
|
get boundTask(): string | null;
|
|
139
140
|
}
|
|
140
141
|
/**
|
|
@@ -330,16 +331,17 @@ declare class Tasks {
|
|
|
330
331
|
/**
|
|
331
332
|
* `client.evals` — eval sets + runs (bring-your-own-data evaluation).
|
|
332
333
|
*
|
|
333
|
-
* // An eval set is DATA +
|
|
334
|
-
* // OPTIONAL —
|
|
335
|
-
*
|
|
336
|
-
*
|
|
334
|
+
* // An eval set is DATA + PROMPT (v3, breaking): prompt REQUIRED, task
|
|
335
|
+
* // OPTIONAL — Pareta works out how to score the results from your
|
|
336
|
+
* // prompt + the data's shape.
|
|
337
|
+
* await pa.evals.proposeContract({ items: [...], prompt: "…" }); // preview
|
|
338
|
+
* const set = await pa.evals.sets.create({ items: [...], prompt: "…" }); // clean match used automatically
|
|
337
339
|
* await pa.evals.sets.uploadDocument(set.id, file, { idx, fieldName }); // blob tasks
|
|
338
340
|
* const run = await pa.evals.runs.create({ evalSet: set.id, models: [...], wait: true });
|
|
339
|
-
* // or, in one call: runs.create({ items,
|
|
341
|
+
* // or, in one call: runs.create({ items, prompt: "…", models, wait: true })
|
|
340
342
|
*
|
|
341
|
-
* `create` (and the inline `runs.create` sugar) require `
|
|
342
|
-
* `task` they call `proposeContract` and
|
|
343
|
+
* `create` (and the inline `runs.create` sugar) require `prompt`; with no
|
|
344
|
+
* `task` they call `proposeContract` and accept ONLY a clean single
|
|
343
345
|
* high/medium match — a conflict, split, or ambiguity throws with the
|
|
344
346
|
* proposals so you pin `task`.
|
|
345
347
|
*
|
|
@@ -357,21 +359,21 @@ declare class EvalSets {
|
|
|
357
359
|
private readonly client;
|
|
358
360
|
constructor(client: Transport);
|
|
359
361
|
/**
|
|
360
|
-
* Persist an eval set from your rows. `
|
|
361
|
-
* on what the model should do with each item. `task` is OPTIONAL — omit it
|
|
362
|
-
*
|
|
363
|
-
* (
|
|
364
|
-
* `task` to pin one explicitly.
|
|
362
|
+
* Persist an eval set from your rows. `prompt` is REQUIRED (v3): one sentence
|
|
363
|
+
* on what the model should do with each item. `task` is OPTIONAL — omit it
|
|
364
|
+
* and Pareta works out how to score the results from your prompt + the
|
|
365
|
+
* data's shape (a clean single match is used; anything ambiguous throws with
|
|
366
|
+
* the proposals). Pass `task` to pin one explicitly.
|
|
365
367
|
*/
|
|
366
368
|
create(params: {
|
|
367
369
|
items: Array<Record<string, unknown>>;
|
|
368
|
-
|
|
370
|
+
prompt: string;
|
|
369
371
|
task?: string;
|
|
370
372
|
name?: string;
|
|
371
373
|
}): Promise<EvalSet>;
|
|
372
|
-
/** Internal: the
|
|
374
|
+
/** Internal: the propose call `create` uses when no task is pinned. Public on
|
|
373
375
|
* `Evals` as `proposeContract`; kept here so `sets.create` can reach it. */
|
|
374
|
-
proposeContract(items: Array<Record<string, unknown>>,
|
|
376
|
+
proposeContract(items: Array<Record<string, unknown>>, prompt: string): Promise<ProposalResult>;
|
|
375
377
|
list(): Promise<EvalSet[]>;
|
|
376
378
|
retrieve(evalSetId: string): Promise<EvalSet>;
|
|
377
379
|
delete(evalSetId: string): Promise<void>;
|
|
@@ -390,7 +392,7 @@ interface EvalRunCreateParams {
|
|
|
390
392
|
evalSet?: string;
|
|
391
393
|
task?: string;
|
|
392
394
|
items?: Array<Record<string, unknown>>;
|
|
393
|
-
|
|
395
|
+
prompt?: string;
|
|
394
396
|
models: string[];
|
|
395
397
|
frontier?: FrontierSpec;
|
|
396
398
|
name?: string;
|
|
@@ -416,14 +418,15 @@ declare class Evals {
|
|
|
416
418
|
constructor(client: Transport);
|
|
417
419
|
private readonly client;
|
|
418
420
|
/**
|
|
419
|
-
*
|
|
421
|
+
* How would your data be scored under your stated `prompt`? Stateless
|
|
420
422
|
* discovery — nothing is persisted. Returns a ProposalResult (ranked
|
|
421
|
-
* proposals, the
|
|
422
|
-
* calls this under the hood; use it directly to
|
|
423
|
+
* proposals, the task a task-less create would use, conflict/split
|
|
424
|
+
* reporting). `sets.create` calls this under the hood; use it directly to
|
|
425
|
+
* preview the scoring first.
|
|
423
426
|
*/
|
|
424
427
|
proposeContract(params: {
|
|
425
428
|
items: Array<Record<string, unknown>>;
|
|
426
|
-
|
|
429
|
+
prompt: string;
|
|
427
430
|
}): Promise<ProposalResult>;
|
|
428
431
|
/**
|
|
429
432
|
* The frontier (vendor) roster you can evaluate against. With `task`, each is
|
|
@@ -712,7 +715,7 @@ declare class Pareta implements Transport {
|
|
|
712
715
|
stream<T = unknown>(method: string, path: string, opts?: StreamOptions): AsyncGenerator<T>;
|
|
713
716
|
}
|
|
714
717
|
|
|
715
|
-
declare const VERSION = "
|
|
718
|
+
declare const VERSION = "3.0.0";
|
|
716
719
|
|
|
717
720
|
/**
|
|
718
721
|
* Typed error hierarchy for the Pareta SDK — a faithful port of the Python
|
package/dist/index.mjs
CHANGED
|
@@ -172,7 +172,7 @@ function parseSSE(reader, opts) {
|
|
|
172
172
|
}
|
|
173
173
|
|
|
174
174
|
// src/version.ts
|
|
175
|
-
var VERSION = "
|
|
175
|
+
var VERSION = "3.0.0";
|
|
176
176
|
|
|
177
177
|
// src/money.ts
|
|
178
178
|
var MICRO_PER_CENT = 10000n;
|
|
@@ -370,9 +370,9 @@ var EvalSet = class extends BaseModel {
|
|
|
370
370
|
return this.raw.scoring_strategy ?? null;
|
|
371
371
|
}
|
|
372
372
|
/** The one-sentence success criterion this set was created with (CB1:
|
|
373
|
-
* DATA +
|
|
374
|
-
get
|
|
375
|
-
return this.raw.
|
|
373
|
+
* DATA + PROMPT). Required at create. */
|
|
374
|
+
get prompt() {
|
|
375
|
+
return this.raw.prompt ?? null;
|
|
376
376
|
}
|
|
377
377
|
};
|
|
378
378
|
function evalSetFromCreate(raw) {
|
|
@@ -411,23 +411,24 @@ var ProposalResult = class extends BaseModel {
|
|
|
411
411
|
get closestTask() {
|
|
412
412
|
return this.raw.closest_task ?? null;
|
|
413
413
|
}
|
|
414
|
-
get
|
|
415
|
-
return this.raw.
|
|
414
|
+
get prompt() {
|
|
415
|
+
return this.raw.prompt ?? null;
|
|
416
416
|
}
|
|
417
417
|
get message() {
|
|
418
418
|
return this.raw.message ?? null;
|
|
419
419
|
}
|
|
420
|
-
/** True when
|
|
421
|
-
*
|
|
422
|
-
*
|
|
423
|
-
*
|
|
424
|
-
*
|
|
425
|
-
* `task: "custom-eval"`, never
|
|
420
|
+
/** True when exactly ONE homogeneous SPECIFIC task matched at high/medium
|
|
421
|
+
* confidence with no conflict/split — the case a task-less `create`
|
|
422
|
+
* proceeds with, no human confirming. `custom-eval` (a judge panel grading
|
|
423
|
+
* each answer against your prompt) is EXCLUDED: it is offered only when
|
|
424
|
+
* nothing specific fits, and using it is the user's CHOICE — opt in with
|
|
425
|
+
* `task: "custom-eval"`, never silently. */
|
|
426
426
|
get isClean() {
|
|
427
427
|
const props = this.proposals;
|
|
428
428
|
return this.homogeneous && this.conflict == null && this.split == null && props.length === 1 && (props[0].confidence === "high" || props[0].confidence === "medium") && Boolean(props[0].taskId) && props[0].taskId !== "custom-eval";
|
|
429
429
|
}
|
|
430
|
-
/**
|
|
430
|
+
/** How a task-less `create` would score this set, or null if the result
|
|
431
|
+
* isn't clean (pass `task` yourself). */
|
|
431
432
|
get boundTask() {
|
|
432
433
|
return this.isClean ? this.proposals[0].taskId : null;
|
|
433
434
|
}
|
|
@@ -776,37 +777,37 @@ async function toBlob(file, mimeOverride) {
|
|
|
776
777
|
const mime = mimeOverride || "application/octet-stream";
|
|
777
778
|
return { blob: new Blob([bytes], { type: mime }), filename: "upload", size: bytes.byteLength, mime };
|
|
778
779
|
}
|
|
779
|
-
function
|
|
780
|
-
const s = (
|
|
780
|
+
function requirePrompt(prompt) {
|
|
781
|
+
const s = (prompt ?? "").trim();
|
|
781
782
|
if (!s) {
|
|
782
783
|
throw new ParetaError(
|
|
783
|
-
'
|
|
784
|
+
'prompt is required: one sentence describing what the model should do with each item (e.g. "extract vendor, total and date from each invoice"). Pass prompt to evals.create / proposeContract.'
|
|
784
785
|
);
|
|
785
786
|
}
|
|
786
787
|
return s.slice(0, 500);
|
|
787
788
|
}
|
|
788
|
-
function itemsJsonl(task, items,
|
|
789
|
+
function itemsJsonl(task, items, prompt, name) {
|
|
789
790
|
if (!items || items.length === 0) throw new ParetaError("items is required and must be non-empty");
|
|
790
791
|
const jsonl = items.map((it) => JSON.stringify(it)).join("\n");
|
|
791
792
|
return {
|
|
792
793
|
files: { items: { filename: `items.${task}.jsonl`, content: jsonl, contentType: "application/jsonl" } },
|
|
793
|
-
data: { task_id: task,
|
|
794
|
+
data: { task_id: task, prompt, name: name || `sdk eval set (${items.length} items)` }
|
|
794
795
|
};
|
|
795
796
|
}
|
|
796
|
-
function proposeMultipart(items,
|
|
797
|
+
function proposeMultipart(items, prompt) {
|
|
797
798
|
if (!items || items.length === 0) throw new ParetaError("items is required and must be non-empty");
|
|
798
799
|
const jsonl = items.map((it) => JSON.stringify(it)).join("\n");
|
|
799
800
|
return {
|
|
800
801
|
files: { items: { filename: "items.jsonl", content: jsonl, contentType: "application/jsonl" } },
|
|
801
|
-
data: {
|
|
802
|
+
data: { prompt }
|
|
802
803
|
};
|
|
803
804
|
}
|
|
804
805
|
function bindError(result) {
|
|
805
|
-
const
|
|
806
|
+
const prompt = result.prompt ?? "";
|
|
806
807
|
if (result.conflict) {
|
|
807
808
|
const c = result.conflict;
|
|
808
809
|
return new ParetaError(
|
|
809
|
-
`
|
|
810
|
+
`prompt '${prompt}' describes a different job than the data's shape supports (reads as '${c.intended_task}': ${c.reasoning}). Pass a task to pin the task, or revise the prompt.`
|
|
810
811
|
);
|
|
811
812
|
}
|
|
812
813
|
if (result.split) {
|
|
@@ -819,14 +820,14 @@ function bindError(result) {
|
|
|
819
820
|
if (props.length === 1 && props[0].taskId === "custom-eval") {
|
|
820
821
|
const warn = props[0].warning ? ` (${props[0].warning})` : "";
|
|
821
822
|
return new ParetaError(
|
|
822
|
-
`no
|
|
823
|
+
`no ready-made scorer fits this data for prompt '${prompt}'. A judge panel can grade each answer against what you asked for (win rate vs gpt-5.5) \u2014 pass task: "custom-eval" to use it.${warn} Or revise the data/prompt so a specific task fits.`
|
|
823
824
|
);
|
|
824
825
|
}
|
|
825
826
|
const options = props.map((p) => p.taskId).filter(Boolean);
|
|
826
827
|
if (options.length === 0 && result.closestTask) options.push(result.closestTask);
|
|
827
828
|
const hint = options.length ? ` Candidates: ${options.join(", ")}.` : "";
|
|
828
829
|
return new ParetaError(
|
|
829
|
-
`
|
|
830
|
+
`couldn't work out how to score this for prompt '${prompt}'.${hint} Pass a task to choose yourself, or inspect evals.proposeContract({ items, prompt }).`
|
|
830
831
|
);
|
|
831
832
|
}
|
|
832
833
|
function mergeCandidates(models, frontierIds) {
|
|
@@ -850,27 +851,27 @@ var EvalSets = class {
|
|
|
850
851
|
}
|
|
851
852
|
client;
|
|
852
853
|
/**
|
|
853
|
-
* Persist an eval set from your rows. `
|
|
854
|
-
* on what the model should do with each item. `task` is OPTIONAL — omit it
|
|
855
|
-
*
|
|
856
|
-
* (
|
|
857
|
-
* `task` to pin one explicitly.
|
|
854
|
+
* Persist an eval set from your rows. `prompt` is REQUIRED (v3): one sentence
|
|
855
|
+
* on what the model should do with each item. `task` is OPTIONAL — omit it
|
|
856
|
+
* and Pareta works out how to score the results from your prompt + the
|
|
857
|
+
* data's shape (a clean single match is used; anything ambiguous throws with
|
|
858
|
+
* the proposals). Pass `task` to pin one explicitly.
|
|
858
859
|
*/
|
|
859
860
|
async create(params) {
|
|
860
|
-
const
|
|
861
|
+
const prompt = requirePrompt(params.prompt);
|
|
861
862
|
let task = params.task;
|
|
862
863
|
if (task == null) {
|
|
863
|
-
const proposal = await this.proposeContract(params.items,
|
|
864
|
+
const proposal = await this.proposeContract(params.items, prompt);
|
|
864
865
|
task = proposal.boundTask ?? void 0;
|
|
865
866
|
if (task == null) throw bindError(proposal);
|
|
866
867
|
}
|
|
867
|
-
const { files, data } = itemsJsonl(task, params.items,
|
|
868
|
+
const { files, data } = itemsJsonl(task, params.items, prompt, params.name);
|
|
868
869
|
return this.client.request("POST", BASE2, { files, data, cast: evalSetFromCreate });
|
|
869
870
|
}
|
|
870
|
-
/** Internal: the
|
|
871
|
+
/** Internal: the propose call `create` uses when no task is pinned. Public on
|
|
871
872
|
* `Evals` as `proposeContract`; kept here so `sets.create` can reach it. */
|
|
872
|
-
proposeContract(items,
|
|
873
|
-
const { files, data } = proposeMultipart(items,
|
|
873
|
+
proposeContract(items, prompt) {
|
|
874
|
+
const { files, data } = proposeMultipart(items, requirePrompt(prompt));
|
|
874
875
|
return this.client.request("POST", PROPOSE, { files, data, cast: proposalResult });
|
|
875
876
|
}
|
|
876
877
|
list() {
|
|
@@ -941,11 +942,11 @@ var EvalRuns = class {
|
|
|
941
942
|
let evalSet = params.evalSet;
|
|
942
943
|
if (evalSet == null) {
|
|
943
944
|
if (!params.items) {
|
|
944
|
-
throw new ParetaError("pass evalSet: <id>, or items (+
|
|
945
|
+
throw new ParetaError("pass evalSet: <id>, or items (+ prompt) to create one");
|
|
945
946
|
}
|
|
946
947
|
evalSet = (await this.sets.create({
|
|
947
948
|
items: params.items,
|
|
948
|
-
|
|
949
|
+
prompt: params.prompt,
|
|
949
950
|
task: params.task,
|
|
950
951
|
name: params.name
|
|
951
952
|
})).id ?? void 0;
|
|
@@ -989,13 +990,14 @@ var Evals = class {
|
|
|
989
990
|
}
|
|
990
991
|
client;
|
|
991
992
|
/**
|
|
992
|
-
*
|
|
993
|
+
* How would your data be scored under your stated `prompt`? Stateless
|
|
993
994
|
* discovery — nothing is persisted. Returns a ProposalResult (ranked
|
|
994
|
-
* proposals, the
|
|
995
|
-
* calls this under the hood; use it directly to
|
|
995
|
+
* proposals, the task a task-less create would use, conflict/split
|
|
996
|
+
* reporting). `sets.create` calls this under the hood; use it directly to
|
|
997
|
+
* preview the scoring first.
|
|
996
998
|
*/
|
|
997
999
|
proposeContract(params) {
|
|
998
|
-
return this.sets.proposeContract(params.items, params.
|
|
1000
|
+
return this.sets.proposeContract(params.items, params.prompt);
|
|
999
1001
|
}
|
|
1000
1002
|
/**
|
|
1001
1003
|
* The frontier (vendor) roster you can evaluate against. With `task`, each is
|