pareta 0.1.0 → 0.2.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 +63 -63
- package/dist/index.cjs +60 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +98 -1
- package/dist/index.d.ts +98 -1
- package/dist/index.mjs +60 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -75,6 +75,16 @@ declare class Endpoint extends BaseModel {
|
|
|
75
75
|
get task(): string | null;
|
|
76
76
|
get url(): string | null;
|
|
77
77
|
get isLive(): boolean;
|
|
78
|
+
/** Structured-extraction endpoints (contract / SEC / ICD …): the system prompt
|
|
79
|
+
* the benchmark used. The proxy applies it automatically when you send no
|
|
80
|
+
* `system` message (so quality matches the leaderboard by default); returned
|
|
81
|
+
* here so you can read it, or override it with your own `system` message.
|
|
82
|
+
* `null` when the task has no injectable prompt (see `promptScaffold`). */
|
|
83
|
+
get recommendedSystemPrompt(): string | null;
|
|
84
|
+
/** Fixed-label classification endpoints: a copy-and-customize `system` prompt
|
|
85
|
+
* template. NEVER auto-applied — the categories are yours, not the benchmark's
|
|
86
|
+
* — so fill them in and send it as your `system` message. `null` otherwise. */
|
|
87
|
+
get promptScaffold(): string | null;
|
|
78
88
|
}
|
|
79
89
|
declare class Task extends BaseModel {
|
|
80
90
|
get id(): string | null;
|
|
@@ -102,6 +112,17 @@ declare class EvalSet extends BaseModel {
|
|
|
102
112
|
get itemCount(): number | null;
|
|
103
113
|
get scoringStrategy(): string | null;
|
|
104
114
|
}
|
|
115
|
+
/**
|
|
116
|
+
* One scored item inside `EvalResult.perItem`. `prediction` is the model's raw
|
|
117
|
+
* output, truncated server-side — present only on items that reached scoring
|
|
118
|
+
* (not pool/build errors), there to debug a 0.0 `score` without re-running.
|
|
119
|
+
*/
|
|
120
|
+
declare class EvalItemResult extends BaseModel {
|
|
121
|
+
get idx(): number | null;
|
|
122
|
+
get score(): number | null;
|
|
123
|
+
get prediction(): string | null;
|
|
124
|
+
get error(): string | null;
|
|
125
|
+
}
|
|
105
126
|
/**
|
|
106
127
|
* One model's aggregate on an eval run. `modelId` is the per-task public alias;
|
|
107
128
|
* `kind` ('open' | 'frontier') is populated by the Slice-4 result schema.
|
|
@@ -115,6 +136,8 @@ declare class EvalResult extends BaseModel {
|
|
|
115
136
|
get meanCostMicroUsd(): number | null;
|
|
116
137
|
get nSucceeded(): number | null;
|
|
117
138
|
get errorCount(): number | null;
|
|
139
|
+
/** Per-item rows (idx/score/prediction/error); empty when not persisted. */
|
|
140
|
+
get perItem(): EvalItemResult[];
|
|
118
141
|
}
|
|
119
142
|
declare class LeaderboardEntry extends BaseModel {
|
|
120
143
|
get name(): string | null;
|
|
@@ -378,6 +401,79 @@ declare class Evals {
|
|
|
378
401
|
frontierModels(task?: string): Promise<FrontierModel[]>;
|
|
379
402
|
}
|
|
380
403
|
|
|
404
|
+
/**
|
|
405
|
+
* `client.auto` — the routing brain's surrounding surfaces.
|
|
406
|
+
*
|
|
407
|
+
* Calling the brain itself is plain chat with `model: "auto"`:
|
|
408
|
+
*
|
|
409
|
+
* client.chat.completions.create({
|
|
410
|
+
* model: "auto",
|
|
411
|
+
* messages: [{ role: "user", content: "…" }],
|
|
412
|
+
* })
|
|
413
|
+
*
|
|
414
|
+
* This resource carries the org-level metrics rollup (requests, success,
|
|
415
|
+
* spend, PROJECTED savings vs frontier) and the metered frontier comparison
|
|
416
|
+
* the Playground uses.
|
|
417
|
+
*/
|
|
418
|
+
|
|
419
|
+
interface AutoMetrics {
|
|
420
|
+
requests_30d: number;
|
|
421
|
+
requests_today: number;
|
|
422
|
+
success_rate_30d: number | null;
|
|
423
|
+
billed_micro_usd_30d: number;
|
|
424
|
+
billed_micro_usd_today: number;
|
|
425
|
+
cost_to_serve_micro_usd_30d: number;
|
|
426
|
+
/** PROJECTED (frontier list-priced counterfactual) — labeled so until
|
|
427
|
+
* dual-run calibration lands. */
|
|
428
|
+
savings_vs_frontier_micro_usd_30d: number | null;
|
|
429
|
+
savings_multiple_30d: number | null;
|
|
430
|
+
performance_hourly_7d: Array<{
|
|
431
|
+
hour: string;
|
|
432
|
+
requests: number;
|
|
433
|
+
error_rate: number;
|
|
434
|
+
p50_ms: number | null;
|
|
435
|
+
p95_ms: number | null;
|
|
436
|
+
}>;
|
|
437
|
+
days_30d: Array<{
|
|
438
|
+
day: string;
|
|
439
|
+
n: number;
|
|
440
|
+
ok: number;
|
|
441
|
+
success_rate: number;
|
|
442
|
+
}>;
|
|
443
|
+
last_request: {
|
|
444
|
+
created_at: string;
|
|
445
|
+
status_code: number;
|
|
446
|
+
duration_ms: number;
|
|
447
|
+
billed_micro_usd: number | null;
|
|
448
|
+
cost_to_serve_micro_usd: number | null;
|
|
449
|
+
} | null;
|
|
450
|
+
}
|
|
451
|
+
interface FrontierComparison {
|
|
452
|
+
model: string;
|
|
453
|
+
content: string;
|
|
454
|
+
cost_micro_usd: number;
|
|
455
|
+
latency_ms: number;
|
|
456
|
+
}
|
|
457
|
+
declare class Auto {
|
|
458
|
+
private readonly client;
|
|
459
|
+
constructor(client: Transport);
|
|
460
|
+
/** Your org's `model: "auto"` traffic, rolled up. Read-only, free. */
|
|
461
|
+
metrics(): Promise<AutoMetrics>;
|
|
462
|
+
/**
|
|
463
|
+
* One prompt against a frontier vendor for a side-by-side with
|
|
464
|
+
* `model: "auto"` — METERED at the vendor's actual token cost (a failed
|
|
465
|
+
* vendor call bills $0). Allowed models: gpt-5.5, gemini-3-5-flash,
|
|
466
|
+
* gemini-3-1-pro, claude-sonnet-4-6.
|
|
467
|
+
*/
|
|
468
|
+
compareFrontier(params: {
|
|
469
|
+
model: string;
|
|
470
|
+
messages: Array<{
|
|
471
|
+
role: string;
|
|
472
|
+
content: string;
|
|
473
|
+
}>;
|
|
474
|
+
}): Promise<FrontierComparison>;
|
|
475
|
+
}
|
|
476
|
+
|
|
381
477
|
/**
|
|
382
478
|
* The `Pareta` client — one class (no sync/async split; JS is Promise-only).
|
|
383
479
|
* A faithful port of the Python `_client.py` transport: header construction,
|
|
@@ -432,6 +528,7 @@ declare class Pareta implements Transport {
|
|
|
432
528
|
readonly endpoints: Endpoints;
|
|
433
529
|
readonly tasks: Tasks;
|
|
434
530
|
readonly evals: Evals;
|
|
531
|
+
readonly auto: Auto;
|
|
435
532
|
constructor(options?: ParetaOptions);
|
|
436
533
|
/** Build from PARETA_API_KEY (+ optional PARETA_BASE_URL); explicit opts win. */
|
|
437
534
|
static fromEnv(options?: ParetaOptions): Pareta;
|
|
@@ -547,4 +644,4 @@ declare class EndpointNotReadyError extends APIStatusError {
|
|
|
547
644
|
constructor(message: string, init: APIStatusErrorInit);
|
|
548
645
|
}
|
|
549
646
|
|
|
550
|
-
export { APIConnectionError, APIStatusError, APITimeoutError, AuthenticationError, BadRequestError, BaseModel, ChatCompletion, ChatCompletionChunk, type ChatCompletionCreateParams, type ChatMessage, Choice, ConflictError, type DeployParams, Endpoint, EndpointMetrics, EndpointNotReadyError, type ErrorDetail, EvalResult, EvalRun, type EvalRunCreateParams, EvalRuns, EvalSet, EvalSets, type FileInput, type FilePart, FrontierModel, type FrontierSpec, InsufficientCreditsError, Leaderboard, LeaderboardEntry, Message, Model, ModelList, NotFoundError, Pareta, ParetaError, type ParetaOptions, PermissionDeniedError, RateLimitError, type SSEEvent, Task, TaskMatch, TaskMatchCandidate, type Transport, Usage, VERSION, type ValidationErrorItem };
|
|
647
|
+
export { APIConnectionError, APIStatusError, APITimeoutError, AuthenticationError, BadRequestError, BaseModel, ChatCompletion, ChatCompletionChunk, type ChatCompletionCreateParams, type ChatMessage, Choice, ConflictError, type DeployParams, Endpoint, EndpointMetrics, EndpointNotReadyError, type ErrorDetail, EvalItemResult, EvalResult, EvalRun, type EvalRunCreateParams, EvalRuns, EvalSet, EvalSets, type FileInput, type FilePart, FrontierModel, type FrontierSpec, InsufficientCreditsError, Leaderboard, LeaderboardEntry, Message, Model, ModelList, NotFoundError, Pareta, ParetaError, type ParetaOptions, PermissionDeniedError, RateLimitError, type SSEEvent, Task, TaskMatch, TaskMatchCandidate, type Transport, Usage, VERSION, type ValidationErrorItem };
|
package/dist/index.mjs
CHANGED
|
@@ -301,6 +301,20 @@ var Endpoint = class extends BaseModel {
|
|
|
301
301
|
get isLive() {
|
|
302
302
|
return this.raw.status === "live";
|
|
303
303
|
}
|
|
304
|
+
/** Structured-extraction endpoints (contract / SEC / ICD …): the system prompt
|
|
305
|
+
* the benchmark used. The proxy applies it automatically when you send no
|
|
306
|
+
* `system` message (so quality matches the leaderboard by default); returned
|
|
307
|
+
* here so you can read it, or override it with your own `system` message.
|
|
308
|
+
* `null` when the task has no injectable prompt (see `promptScaffold`). */
|
|
309
|
+
get recommendedSystemPrompt() {
|
|
310
|
+
return this.raw.recommendedSystemPrompt ?? null;
|
|
311
|
+
}
|
|
312
|
+
/** Fixed-label classification endpoints: a copy-and-customize `system` prompt
|
|
313
|
+
* template. NEVER auto-applied — the categories are yours, not the benchmark's
|
|
314
|
+
* — so fill them in and send it as your `system` message. `null` otherwise. */
|
|
315
|
+
get promptScaffold() {
|
|
316
|
+
return this.raw.promptScaffold ?? null;
|
|
317
|
+
}
|
|
304
318
|
};
|
|
305
319
|
function endpointList(raw) {
|
|
306
320
|
return (raw ?? []).map((e) => new Endpoint(e));
|
|
@@ -373,6 +387,20 @@ function evalSetFromCreate(raw) {
|
|
|
373
387
|
function evalSetList(raw) {
|
|
374
388
|
return (raw?.eval_sets ?? []).map((e) => new EvalSet(e));
|
|
375
389
|
}
|
|
390
|
+
var EvalItemResult = class extends BaseModel {
|
|
391
|
+
get idx() {
|
|
392
|
+
return this.raw.idx ?? null;
|
|
393
|
+
}
|
|
394
|
+
get score() {
|
|
395
|
+
return this.raw.score ?? null;
|
|
396
|
+
}
|
|
397
|
+
get prediction() {
|
|
398
|
+
return this.raw.prediction ?? null;
|
|
399
|
+
}
|
|
400
|
+
get error() {
|
|
401
|
+
return this.raw.error ?? null;
|
|
402
|
+
}
|
|
403
|
+
};
|
|
376
404
|
var EvalResult = class extends BaseModel {
|
|
377
405
|
get modelId() {
|
|
378
406
|
return this.raw.model_id ?? null;
|
|
@@ -399,6 +427,10 @@ var EvalResult = class extends BaseModel {
|
|
|
399
427
|
get errorCount() {
|
|
400
428
|
return this.raw.error_count ?? null;
|
|
401
429
|
}
|
|
430
|
+
/** Per-item rows (idx/score/prediction/error); empty when not persisted. */
|
|
431
|
+
get perItem() {
|
|
432
|
+
return (this.raw.per_item ?? []).map((it) => new EvalItemResult(it));
|
|
433
|
+
}
|
|
402
434
|
};
|
|
403
435
|
var LeaderboardEntry = class extends BaseModel {
|
|
404
436
|
get name() {
|
|
@@ -863,6 +895,31 @@ var Evals = class {
|
|
|
863
895
|
}
|
|
864
896
|
};
|
|
865
897
|
|
|
898
|
+
// src/resources/auto.ts
|
|
899
|
+
var Auto = class {
|
|
900
|
+
constructor(client) {
|
|
901
|
+
this.client = client;
|
|
902
|
+
}
|
|
903
|
+
client;
|
|
904
|
+
/** Your org's `model: "auto"` traffic, rolled up. Read-only, free. */
|
|
905
|
+
metrics() {
|
|
906
|
+
return this.client.request("GET", "/v1/auto/metrics");
|
|
907
|
+
}
|
|
908
|
+
/**
|
|
909
|
+
* One prompt against a frontier vendor for a side-by-side with
|
|
910
|
+
* `model: "auto"` — METERED at the vendor's actual token cost (a failed
|
|
911
|
+
* vendor call bills $0). Allowed models: gpt-5.5, gemini-3-5-flash,
|
|
912
|
+
* gemini-3-1-pro, claude-sonnet-4-6.
|
|
913
|
+
*/
|
|
914
|
+
compareFrontier(params) {
|
|
915
|
+
return this.client.request(
|
|
916
|
+
"POST",
|
|
917
|
+
"/v1/playground/frontier",
|
|
918
|
+
{ body: params }
|
|
919
|
+
);
|
|
920
|
+
}
|
|
921
|
+
};
|
|
922
|
+
|
|
866
923
|
// src/client.ts
|
|
867
924
|
var DEFAULT_BASE_URL = "https://api.pareta.ai";
|
|
868
925
|
var DEFAULT_TIMEOUT_MS = 6e4;
|
|
@@ -883,6 +940,7 @@ var Pareta = class _Pareta {
|
|
|
883
940
|
endpoints;
|
|
884
941
|
tasks;
|
|
885
942
|
evals;
|
|
943
|
+
auto;
|
|
886
944
|
constructor(options = {}) {
|
|
887
945
|
if (!options.apiKey) {
|
|
888
946
|
throw new ParetaError(
|
|
@@ -903,6 +961,7 @@ var Pareta = class _Pareta {
|
|
|
903
961
|
this.endpoints = new Endpoints(this);
|
|
904
962
|
this.tasks = new Tasks(this);
|
|
905
963
|
this.evals = new Evals(this);
|
|
964
|
+
this.auto = new Auto(this);
|
|
906
965
|
}
|
|
907
966
|
/** Build from PARETA_API_KEY (+ optional PARETA_BASE_URL); explicit opts win. */
|
|
908
967
|
static fromEnv(options = {}) {
|
|
@@ -1077,6 +1136,6 @@ var Pareta = class _Pareta {
|
|
|
1077
1136
|
}
|
|
1078
1137
|
};
|
|
1079
1138
|
|
|
1080
|
-
export { APIConnectionError, APIStatusError, APITimeoutError, AuthenticationError, BadRequestError, BaseModel, ChatCompletion, ChatCompletionChunk, Choice, ConflictError, Endpoint, EndpointMetrics, EndpointNotReadyError, EvalResult, EvalRun, EvalRuns, EvalSet, EvalSets, FrontierModel, InsufficientCreditsError, Leaderboard, LeaderboardEntry, Message, Model, ModelList, NotFoundError, Pareta, ParetaError, PermissionDeniedError, RateLimitError, Task, TaskMatch, TaskMatchCandidate, Usage, VERSION };
|
|
1139
|
+
export { APIConnectionError, APIStatusError, APITimeoutError, AuthenticationError, BadRequestError, BaseModel, ChatCompletion, ChatCompletionChunk, Choice, ConflictError, Endpoint, EndpointMetrics, EndpointNotReadyError, EvalItemResult, EvalResult, EvalRun, EvalRuns, EvalSet, EvalSets, FrontierModel, InsufficientCreditsError, Leaderboard, LeaderboardEntry, Message, Model, ModelList, NotFoundError, Pareta, ParetaError, PermissionDeniedError, RateLimitError, Task, TaskMatch, TaskMatchCandidate, Usage, VERSION };
|
|
1081
1140
|
//# sourceMappingURL=index.mjs.map
|
|
1082
1141
|
//# sourceMappingURL=index.mjs.map
|