@adaptic/utils 0.0.1032 → 0.0.1034
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/index.cjs +325 -75
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +325 -76
- package/dist/index.mjs.map +1 -1
- package/dist/types/alpaca/trading/order-utils.d.ts.map +1 -1
- package/dist/types/llm/circuit-breaker.d.ts +18 -1
- package/dist/types/llm/circuit-breaker.d.ts.map +1 -1
- package/dist/types/llm/fallback-chain.d.ts.map +1 -1
- package/dist/types/llm/index.d.ts +3 -1
- package/dist/types/llm/index.d.ts.map +1 -1
- package/dist/types/llm/rate-guard.d.ts +82 -9
- package/dist/types/llm/rate-guard.d.ts.map +1 -1
- package/dist/types/llm/structured-content.d.ts +73 -0
- package/dist/types/llm/structured-content.d.ts.map +1 -0
- package/dist/types/llm/transports/gateway.d.ts.map +1 -1
- package/dist/types/schemas/alpaca-schemas.d.ts.map +1 -1
- package/dist/types/trading-policy/schemas/effective-policy.schema.d.ts +18 -18
- package/dist/types/trading-policy/schemas/model-prefs.schema.d.ts +24 -24
- package/dist/types/trading-policy/schemas/policy-mutation.schema.d.ts +36 -36
- package/dist/types/types/alpaca-types.d.ts +10 -3
- package/dist/types/types/alpaca-types.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"order-utils.d.ts","sourceRoot":"","sources":["../../../../src/alpaca/trading/order-utils.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAGzC,OAAO,EACL,WAAW,EAEX,eAAe,EAEhB,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"order-utils.d.ts","sourceRoot":"","sources":["../../../../src/alpaca/trading/order-utils.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAA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,MAAM,CAKzD;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAK/D;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,WAAW,EAAE,GACpB,GAAG,CAAC,MAAM,EAAE,WAAW,EAAE,CAAC,CAU5B;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,WAAW,EAAE,GACpB,GAAG,CAAC,MAAM,EAAE,WAAW,EAAE,CAAC,CAU5B;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,CAavE;AAED;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,WAAW,EAAE,EACrB,SAAS,EAAE,IAAI,EACf,OAAO,EAAE,IAAI,GACZ,WAAW,EAAE,CAQf;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,WAAW,EAAE,EACrB,SAAS,GAAE,KAAK,GAAG,MAAe,GACjC,WAAW,EAAE,CAWf;AAED;;GAEG;;;;;;;;;;;;;;;;;;;;;;;AACH,wBA0BE"}
|
|
@@ -71,9 +71,26 @@ export declare class CircuitBreakerRegistry {
|
|
|
71
71
|
* Register that an attempt is starting, so half-open probes stay bounded.
|
|
72
72
|
*
|
|
73
73
|
* @param routeKey The route's stable key.
|
|
74
|
+
* @returns Whether the attempt took a half-open probe slot. A caller holding
|
|
75
|
+
* one must end the attempt with {@link onSuccess}, {@link onFailure} or
|
|
76
|
+
* {@link onAttemptAbandoned}, or the slot is never returned.
|
|
77
|
+
*/
|
|
78
|
+
onAttemptStart(routeKey: string): boolean;
|
|
79
|
+
/**
|
|
80
|
+
* Return a half-open probe slot whose attempt ended without a verdict.
|
|
81
|
+
*
|
|
82
|
+
* A probe that never tested the provider — refused by the client's own
|
|
83
|
+
* pacing guard, cancelled by its caller, or found to be the wrong leg for the
|
|
84
|
+
* request — says nothing about whether the route has recovered, so neither a
|
|
85
|
+
* success nor a failure is recorded. The slot must still come back. Without
|
|
86
|
+
* it the half-open route admits no further probe, no probe can ever close or
|
|
87
|
+
* re-open the breaker, and the route stays excluded for the life of the
|
|
88
|
+
* process while its traffic is quietly served by the next leg.
|
|
89
|
+
*
|
|
90
|
+
* @param routeKey The route's stable key.
|
|
74
91
|
* @returns void
|
|
75
92
|
*/
|
|
76
|
-
|
|
93
|
+
onAttemptAbandoned(routeKey: string): void;
|
|
77
94
|
/**
|
|
78
95
|
* Record a success, closing the breaker.
|
|
79
96
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"circuit-breaker.d.ts","sourceRoot":"","sources":["../../../src/llm/circuit-breaker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAElD,0DAA0D;AAC1D,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,MAAM,GAAG,WAAW,CAAC;AAE3D,oEAAoE;AACpE,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC;IAC7B,QAAQ,CAAC,mBAAmB,EAAE,MAAM,CAAC;IACrC,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;CACjC;AAQD;;GAEG;AACH,qBAAa,sBAAsB;IACjC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAoC;IAE5D,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAqB;IAE5C,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAe;IAEnC;;;OAGG;gBACgB,MAAM,EAAE,kBAAkB,EAAE,GAAG,GAAE,MAAM,MAAiB;IAK3E;;;;;;;;;;OAUG;IACI,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IACI,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAQxC;;;;;;;;OAQG;IACI,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAWxC;;;;;OAKG;IACI,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,eAAe;IAelD;;;;OAIG;IACI,WAAW,IAAI,eAAe,EAAE;IAMvC;;;;OAIG;IACI,KAAK,IAAI,IAAI;IAIpB;;;OAGG;IACH,OAAO,CAAC,SAAS;CAQlB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fallback-chain.d.ts","sourceRoot":"","sources":["../../../src/llm/fallback-chain.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,EAAE,0BAA0B,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"fallback-chain.d.ts","sourceRoot":"","sources":["../../../src/llm/fallback-chain.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,EAAE,0BAA0B,EAAE,MAAM,gBAAgB,CAAC;AAG5D,OAAO,KAAK,EACV,kBAAkB,EAClB,YAAY,EACZ,mBAAmB,EACnB,oBAAoB,EACpB,cAAc,EACd,aAAa,EACd,MAAM,SAAS,CAAC;AAWjB,uDAAuD;AACvD,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC;IAC9B,8CAA8C;IAC9C,QAAQ,CAAC,SAAS,EAAE,YAAY,CAAC;IACjC,gFAAgF;IAChF,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,0BAA0B,CAAC;CACvE;AAED,kDAAkD;AAClD,MAAM,WAAW,cAAc;IAC7B,QAA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,EAAE,cAAc;CAiB7B;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,QAAQ,CACtB,CAAC,EAAE,cAAc,EACjB,CAAC,EAAE,cAAc,GAAG,SAAS,GAC5B,cAAc,CAmBhB;AA4ID;;;;;;;GAOG;AACH,wBAAsB,YAAY,CAAC,CAAC,EAClC,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,cAAc,GACxB,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAmG1B"}
|
|
@@ -15,7 +15,9 @@ export { NoServableRouteError, UnknownAliasError, closedIncumbentLeg, gatewayMod
|
|
|
15
15
|
export type { ResolvedChain, RouteExclusion } from "./route-table";
|
|
16
16
|
export { UnsupportedCapabilityError, normaliseParams, routeSupports } from "./param-matrix";
|
|
17
17
|
export { RateGuardTimeoutError, guardSnapshots, limitsFor, limitsInventory, resetProviderGuards, withProviderGuards, } from "./rate-guard";
|
|
18
|
-
export type { GuardSnapshot, ProviderLimits } from "./rate-guard";
|
|
18
|
+
export type { GuardCallScope, GuardSnapshot, ProviderLimitBasis, ProviderLimitScope, ProviderLimits, } from "./rate-guard";
|
|
19
|
+
export { LlmResponseFormatError } from "./structured-content";
|
|
20
|
+
export type { StructuredResponseFormat } from "./structured-content";
|
|
19
21
|
export { CircuitBreakerRegistry } from "./circuit-breaker";
|
|
20
22
|
export type { BreakerSnapshot, BreakerState } from "./circuit-breaker";
|
|
21
23
|
export { SchemaRetryExhaustedError, buildRetryPrompt, callWithValidation } from "./schema-retry";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/llm/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7F,OAAO,EACL,mBAAmB,EACnB,QAAQ,GACT,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAElD,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACnB,WAAW,EACX,aAAa,EACb,YAAY,EACZ,WAAW,EACX,UAAU,GACX,MAAM,eAAe,CAAC;AACvB,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAEnE,OAAO,EAAE,0BAA0B,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE5F,OAAO,EACL,qBAAqB,EACrB,cAAc,EACd,SAAS,EACT,eAAe,EACf,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,cAAc,CAAC;AACtB,YAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/llm/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7F,OAAO,EACL,mBAAmB,EACnB,QAAQ,GACT,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAElD,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACnB,WAAW,EACX,aAAa,EACb,YAAY,EACZ,WAAW,EACX,UAAU,GACX,MAAM,eAAe,CAAC;AACvB,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAEnE,OAAO,EAAE,0BAA0B,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE5F,OAAO,EACL,qBAAqB,EACrB,cAAc,EACd,SAAS,EACT,eAAe,EACf,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,cAAc,CAAC;AACtB,YAAY,EACV,cAAc,EACd,aAAa,EACb,kBAAkB,EAClB,kBAAkB,EAClB,cAAc,GACf,MAAM,cAA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uit breaker, fail over to a more expensive leg, and keep doing
|
|
9
9
|
* so — converting a self-inflicted pacing problem into a permanent routing
|
|
10
10
|
* change nobody chose. Pacing at the client is what keeps the breaker measuring
|
|
11
|
-
* the provider rather than measuring us.
|
|
11
|
+
* the provider rather than measuring us. The same reasoning bounds the guard
|
|
12
|
+
* from the other side: a client held far BELOW the provider's ceiling refuses
|
|
13
|
+
* calls the provider would have served, and the chain answers those refusals by
|
|
14
|
+
* failing over — the same unchosen routing change, arrived at by under-driving.
|
|
12
15
|
*
|
|
13
16
|
* Two distinct bounds are applied because they fail differently. The rate bound
|
|
14
17
|
* (requests per minute) protects the provider's published ceiling. The
|
|
@@ -17,16 +20,51 @@
|
|
|
17
20
|
* every one of them blows its latency budget and the fan-out produces a hundred
|
|
18
21
|
* timeouts instead of a queue.
|
|
19
22
|
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
23
|
+
* Each guard is keyed by the unit its provider enforces limits in. A provider
|
|
24
|
+
* that publishes its ceilings per model gets one independent guard per model.
|
|
25
|
+
* Sharing one guard across its models would enforce a ceiling the provider does
|
|
26
|
+
* not impose, and — when a chain's primary and secondary are served by the same
|
|
27
|
+
* provider — would refuse the secondary at exactly the moment the primary's
|
|
28
|
+
* queue is full, so the fallback that exists for that moment is never reached.
|
|
29
|
+
*
|
|
30
|
+
* Limits live in `provider-limits.json` rather than in code, each beside the
|
|
31
|
+
* source it was transcribed from, so a published ceiling and a conservative
|
|
32
|
+
* guess can never be mistaken for one another in review. The file is bundled
|
|
33
|
+
* at build time: changing a limit is a release of this package, not a runtime
|
|
34
|
+
* switch.
|
|
22
35
|
*
|
|
23
36
|
* @module llm/rate-guard
|
|
24
37
|
*/
|
|
38
|
+
/** Where a limit came from: a provider's documented ceiling, or a deliberate under-estimate of an unknown one. */
|
|
39
|
+
export type ProviderLimitBasis = "published" | "conservative-default";
|
|
40
|
+
/**
|
|
41
|
+
* The unit a provider enforces its limits in.
|
|
42
|
+
*
|
|
43
|
+
* `model` means each of the provider's models has its own ceilings, so the
|
|
44
|
+
* client keeps one guard per model; `provider` means one guard covers every
|
|
45
|
+
* model the provider serves.
|
|
46
|
+
*/
|
|
47
|
+
export type ProviderLimitScope = "provider" | "model";
|
|
25
48
|
/** Limits for one provider. */
|
|
26
49
|
export interface ProviderLimits {
|
|
27
50
|
/** Whether these numbers were transcribed from a provider doc or chosen conservatively. */
|
|
28
|
-
readonly basis:
|
|
51
|
+
readonly basis: ProviderLimitBasis;
|
|
52
|
+
/** The unit the provider enforces its limits in. Absent means `provider`. */
|
|
53
|
+
readonly scope?: ProviderLimitScope;
|
|
54
|
+
/**
|
|
55
|
+
* Where a per-model scope was read from, when the entry's numbers are not
|
|
56
|
+
* themselves published. The unit is a claim about the provider and carries
|
|
57
|
+
* the same burden of proof as a number.
|
|
58
|
+
*/
|
|
59
|
+
readonly scope_source?: string | null;
|
|
29
60
|
readonly requests_per_minute: number;
|
|
61
|
+
/**
|
|
62
|
+
* Provenance of `requests_per_minute` when it differs from `basis`. A provider
|
|
63
|
+
* can publish a concurrency ceiling and no per-minute ceiling at all; the
|
|
64
|
+
* per-minute number is then the client's own choice and must not borrow the
|
|
65
|
+
* published label of the bound that was transcribed.
|
|
66
|
+
*/
|
|
67
|
+
readonly requests_per_minute_basis?: ProviderLimitBasis;
|
|
30
68
|
readonly max_concurrent: number;
|
|
31
69
|
readonly acquire_timeout_ms: number;
|
|
32
70
|
/** Where a published limit was read from. Null while the basis is a conservative default. */
|
|
@@ -50,6 +88,28 @@ export declare function limitsInventory(): {
|
|
|
50
88
|
provider: string;
|
|
51
89
|
limits: ProviderLimits;
|
|
52
90
|
}[];
|
|
91
|
+
/** Which guard a call is held by, and how its caller can stop waiting. */
|
|
92
|
+
export interface GuardCallScope {
|
|
93
|
+
/**
|
|
94
|
+
* The model the call is addressed to. Selects the guard for a provider whose
|
|
95
|
+
* limits apply per model; ignored for a provider whose limits apply per
|
|
96
|
+
* provider.
|
|
97
|
+
*/
|
|
98
|
+
readonly modelId?: string;
|
|
99
|
+
/**
|
|
100
|
+
* The caller's cancellation. A caller that stops waiting leaves the queue at
|
|
101
|
+
* once rather than holding its place until its wait budget runs out, and a
|
|
102
|
+
* permit freed after it has gone goes to a caller that is still waiting.
|
|
103
|
+
*/
|
|
104
|
+
readonly signal?: AbortSignal;
|
|
105
|
+
}
|
|
106
|
+
/** What a refusal says about the call it refused. */
|
|
107
|
+
interface RefusalDetail {
|
|
108
|
+
/** The model whose guard refused the call, for a provider whose limits apply per model. */
|
|
109
|
+
readonly modelId?: string;
|
|
110
|
+
/** Whether the caller stopped waiting before the guard's own budget ran out. */
|
|
111
|
+
readonly abandoned?: boolean;
|
|
112
|
+
}
|
|
53
113
|
/**
|
|
54
114
|
* Thrown when a caller could not acquire a slot within its budget.
|
|
55
115
|
*
|
|
@@ -61,12 +121,17 @@ export declare class RateGuardTimeoutError extends Error {
|
|
|
61
121
|
readonly provider: string;
|
|
62
122
|
/** Which of the two bounds the caller waited on. */
|
|
63
123
|
readonly bound: "rate" | "concurrency";
|
|
124
|
+
/** The model whose guard refused the call, when the provider's limits apply per model. */
|
|
125
|
+
readonly modelId: string | undefined;
|
|
126
|
+
/** Whether the caller stopped waiting before the guard's own wait budget ran out. */
|
|
127
|
+
readonly abandoned: boolean;
|
|
64
128
|
/**
|
|
65
129
|
* @param provider The provider.
|
|
66
130
|
* @param bound Which bound was binding.
|
|
67
|
-
* @param waitedMs How long the caller
|
|
131
|
+
* @param waitedMs How long the caller was prepared to wait.
|
|
132
|
+
* @param detail The model, and whether the caller left before the budget ran out.
|
|
68
133
|
*/
|
|
69
|
-
constructor(provider: string, bound: "rate" | "concurrency", waitedMs: number);
|
|
134
|
+
constructor(provider: string, bound: "rate" | "concurrency", waitedMs: number, detail?: RefusalDetail);
|
|
70
135
|
}
|
|
71
136
|
/**
|
|
72
137
|
* Run a call under a provider's rate and concurrency guards.
|
|
@@ -86,13 +151,20 @@ export declare class RateGuardTimeoutError extends Error {
|
|
|
86
151
|
* @param provider The provider key.
|
|
87
152
|
* @param call The work to run once admitted.
|
|
88
153
|
* @param maxWaitMs Ceiling on queue time; the configured guard timeout applies when lower.
|
|
154
|
+
* @param scope The model the call addresses, and the caller's cancellation.
|
|
89
155
|
* @returns The call's result.
|
|
90
|
-
* @throws {RateGuardTimeoutError} When neither bound admitted the call in time
|
|
156
|
+
* @throws {RateGuardTimeoutError} When neither bound admitted the call in time,
|
|
157
|
+
* or the caller stopped waiting first.
|
|
91
158
|
*/
|
|
92
|
-
export declare function withProviderGuards<T>(provider: string, call: () => Promise<T>, maxWaitMs?: number): Promise<T>;
|
|
159
|
+
export declare function withProviderGuards<T>(provider: string, call: () => Promise<T>, maxWaitMs?: number, scope?: GuardCallScope): Promise<T>;
|
|
93
160
|
/** Observable guard state, for dashboards and tests. */
|
|
94
161
|
export interface GuardSnapshot {
|
|
162
|
+
/** The guard's identity: the provider, or `provider/model` for a per-model guard. */
|
|
163
|
+
readonly key: string;
|
|
95
164
|
readonly provider: string;
|
|
165
|
+
/** The model this guard covers, for a provider whose limits apply per model. */
|
|
166
|
+
readonly modelId: string | undefined;
|
|
167
|
+
readonly scope: ProviderLimitScope;
|
|
96
168
|
readonly basis: ProviderLimits["basis"];
|
|
97
169
|
readonly requestsPerMinute: number;
|
|
98
170
|
readonly maxConcurrent: number;
|
|
@@ -104,7 +176,7 @@ export interface GuardSnapshot {
|
|
|
104
176
|
/**
|
|
105
177
|
* Inspect the guards currently in use.
|
|
106
178
|
*
|
|
107
|
-
* @returns A snapshot per
|
|
179
|
+
* @returns A snapshot per guard that has been used, sorted by guard key.
|
|
108
180
|
*/
|
|
109
181
|
export declare function guardSnapshots(): GuardSnapshot[];
|
|
110
182
|
/**
|
|
@@ -116,4 +188,5 @@ export declare function guardSnapshots(): GuardSnapshot[];
|
|
|
116
188
|
* @returns void
|
|
117
189
|
*/
|
|
118
190
|
export declare function resetProviderGuards(): void;
|
|
191
|
+
export {};
|
|
119
192
|
//# sourceMappingURL=rate-guard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rate-guard.d.ts","sourceRoot":"","sources":["../../../src/llm/rate-guard.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"rate-guard.d.ts","sourceRoot":"","sources":["../../../src/llm/rate-guard.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAYH,kHAAkH;AAClH,MAAM,MAAM,kBAAkB,GAAG,WAAW,GAAG,sBAAsB,CAAC;AAEtE;;;;;;GAMG;AACH,MAAM,MAAM,kBAAkB,GAAG,UAAU,GAAG,OAAO,CAAC;AAEtD,+BAA+B;AAC/B,MAAM,WAAW,cAAc;IAC7B,2FAA2F;IAC3F,QAAQ,CAAC,KAAK,EAAE,kBAAkB,CAAC;IACnC,6EAA6E;IAC7E,QAAQ,CAAC,KAAK,CAAC,EAAE,kBAAkB,CAAC;IACpC;;;;OAIG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC,QAAQ,CAAC,mBAAmB,EAAE,MAAM,CAAC;IACrC;;;;;OAKG;IACH,QAAQ,CAAC,yBAAyB,CAAC,EAAE,kBAAkB,CAAC;IACxD,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC;IACpC,6FAA6F;IAC7F,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACxB;AAYD;;;;;;;;;;GAUG;AACH,wBAAgB,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,cAAc,CAE1D;AAED,uFAAuF;AACvF,wBAAgB,eAAe,IAAI;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,cAAc,CAAA;CAAE,EAAE,CAIhF;AAED,0EAA0E;AAC1E,MAAM,WAAW,cAAc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ACnC,QAAQ,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC;IACxC,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,sBAAsB,EAAE,MAAM,CAAC;IACxC,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;CAClC;AAED;;;;GAIG;AACH,wBAAgB,cAAc,IAAI,aAAa,EAAE,CAsBhD;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,IAAI,IAAI,CAO1C"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interpretation of a model's answer to a structured (JSON) request.
|
|
3
|
+
*
|
|
4
|
+
* A JSON request is a promise about the answer's SHAPE, and providers keep it
|
|
5
|
+
* in different ways. An OpenAI-compatible host given `json_object` constrains
|
|
6
|
+
* its decoder, so its answer is bare JSON. A provider with no schema-less JSON
|
|
7
|
+
* mode — Anthropic, reached through the gateway, supports structured output
|
|
8
|
+
* only against a caller-supplied schema — receives nothing but the prompt's
|
|
9
|
+
* instructions for a `json` request, and a model following them commonly
|
|
10
|
+
* returns the object inside one markdown code fence. The fence is presentation,
|
|
11
|
+
* not content: the object inside it is the answer the model gave.
|
|
12
|
+
*
|
|
13
|
+
* So exactly ONE enclosing fence is removed before parsing, and nothing else is
|
|
14
|
+
* forgiven. Prose before or after the fence, two fenced blocks, a fence that
|
|
15
|
+
* never closes (a truncated answer), and a fence declaring another language all
|
|
16
|
+
* still fail. Each of those is an answer whose meaning a parser would have to
|
|
17
|
+
* guess, and a guessed object is a decision made on data no model produced.
|
|
18
|
+
*
|
|
19
|
+
* Content that is not fenced is parsed exactly as it always was: JSON cannot
|
|
20
|
+
* begin with a backtick, so every answer that parsed before this unwrapping
|
|
21
|
+
* existed takes the same path and yields the same value.
|
|
22
|
+
*
|
|
23
|
+
* @module llm/structured-content
|
|
24
|
+
*/
|
|
25
|
+
import type { LlmResponseFormat, LlmUsageRecord } from "./types";
|
|
26
|
+
/** A response format that promises structured content. */
|
|
27
|
+
export type StructuredResponseFormat = Exclude<LlmResponseFormat, "text">;
|
|
28
|
+
/**
|
|
29
|
+
* Thrown when a provider answered a structured request with content that does
|
|
30
|
+
* not parse.
|
|
31
|
+
*
|
|
32
|
+
* Carries the usage the provider billed for that answer. The tokens were spent
|
|
33
|
+
* whether or not the content parsed, and a chain that dropped them would report
|
|
34
|
+
* a failed attempt as free — understating spend by exactly the calls that went
|
|
35
|
+
* wrong.
|
|
36
|
+
*/
|
|
37
|
+
export declare class LlmResponseFormatError extends Error {
|
|
38
|
+
/** The format the caller asked for. */
|
|
39
|
+
readonly responseFormat: "json" | "json_schema";
|
|
40
|
+
/** What the provider billed for the answer that did not parse. */
|
|
41
|
+
readonly usage: LlmUsageRecord;
|
|
42
|
+
/** Whether the answer sat inside one enclosing fence that was removed before parsing. */
|
|
43
|
+
readonly fenced: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* @param responseFormat The format the caller asked for.
|
|
46
|
+
* @param usage What the provider billed for the answer.
|
|
47
|
+
* @param fenced Whether one enclosing fence was removed before parsing.
|
|
48
|
+
* @param cause The parser's own complaint.
|
|
49
|
+
*/
|
|
50
|
+
constructor(responseFormat: "json" | "json_schema", usage: LlmUsageRecord, fenced: boolean, cause: unknown);
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* The body of the one markdown fence that encloses an answer, if exactly one does.
|
|
54
|
+
*
|
|
55
|
+
* @param text The model's answer.
|
|
56
|
+
* @returns The fenced body, or null when the answer is not wholly one fenced block.
|
|
57
|
+
*/
|
|
58
|
+
export declare function unwrapSingleJsonFence(text: string): string | null;
|
|
59
|
+
/**
|
|
60
|
+
* Parse a model's answer to a structured request.
|
|
61
|
+
*
|
|
62
|
+
* A JSON format that does not parse is an error, not an empty object. Returning
|
|
63
|
+
* a default here would hand the caller a well-typed value that means nothing,
|
|
64
|
+
* and the failure would surface much later as a decision made on absent data.
|
|
65
|
+
*
|
|
66
|
+
* @param content The raw content of the model's message.
|
|
67
|
+
* @param responseFormat The structured format the caller asked for.
|
|
68
|
+
* @param usage What the provider billed for this answer, carried on failure.
|
|
69
|
+
* @returns The parsed value.
|
|
70
|
+
* @throws {LlmResponseFormatError} When the content is not JSON, fenced or not.
|
|
71
|
+
*/
|
|
72
|
+
export declare function parseStructuredContent<T>(content: unknown, responseFormat: StructuredResponseFormat, usage: LlmUsageRecord): T;
|
|
73
|
+
//# sourceMappingURL=structured-content.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"structured-content.d.ts","sourceRoot":"","sources":["../../../src/llm/structured-content.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEjE,0DAA0D;AAC1D,MAAM,MAAM,wBAAwB,GAAG,OAAO,CAAC,iBAAiB,EAAE,MAAM,CAAC,CAAC;AAW1E;;;;;;;;GAQG;AACH,qBAAa,sBAAuB,SAAQ,KAAK;IAC/C,uCAAuC;IACvC,SAAgB,cAAc,EAAE,MAAM,GAAG,aAAa,CAAC;IAEvD,kEAAkE;IAClE,SAAgB,KAAK,EAAE,cAAc,CAAC;IAEtC,yFAAyF;IACzF,SAAgB,MAAM,EAAE,OAAO,CAAC;IAEhC;;;;;OAKG;gBAED,cAAc,EAAE,MAAM,GAAG,aAAa,EACtC,KAAK,EAAE,cAAc,EACrB,MAAM,EAAE,OAAO,EACf,KAAK,EAAE,OAAO;CAYjB;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAGjE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,EACtC,OAAO,EAAE,OAAO,EAChB,cAAc,EAAE,wBAAwB,EACxC,KAAK,EAAE,cAAc,GACpB,CAAC,CAaH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gateway.d.ts","sourceRoot":"","sources":["../../../../src/llm/transports/gateway.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;
|
|
1
|
+
{"version":3,"file":"gateway.d.ts","sourceRoot":"","sources":["../../../../src/llm/transports/gateway.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,KAAK,EACV,YAAY,EACZ,mBAAmB,EAGpB,MAAM,UAAU,CAAC;AAQlB,+CAA+C;AAC/C,MAAM,WAAW,sBAAsB;IACrC,kEAAkE;IAClE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,kEAAkE;IAClE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,0DAA0D;IAC1D,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,KAAK,CAAC;IAClC;;;;;;OAMG;IACH,QAAQ,CAAC,YAAY,EAAE,CAAC,OAAO,EAAE,mBAAmB,KAAK,MAAM,CAAC;CACjE;AAED;;;;;;;;GAQG;AACH,qBAAa,uBAAwB,SAAQ,KAAK;IAChD;;;OAGG;gBACgB,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO;CAMnD;AAED,4DAA4D;AAC5D,qBAAa,oBAAqB,SAAQ,KAAK;IAC7C,uBAAuB;IACvB,SAAgB,MAAM,EAAE,MAAM,CAAC;IAE/B,8DAA8D;IAC9D,SAAgB,SAAS,EAAE,OAAO,CAAC;IAEnC;;;OAGG;gBACgB,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;CAMhD;AAwDD;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,sBAAsB,GAC7B,YAAY,CA8Dd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alpaca-schemas.d.ts","sourceRoot":"","sources":["../../../src/schemas/alpaca-schemas.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAexB,iDAAiD;AACjD,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+CrC,CAAC;AAIH,0CAA0C;AAC1C,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmB/B,CAAC;AAEH,8CAA8C;AAC9C,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"alpaca-schemas.d.ts","sourceRoot":"","sources":["../../../src/schemas/alpaca-schemas.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAexB,iDAAiD;AACjD,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+CrC,CAAC;AAIH,0CAA0C;AAC1C,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmB/B,CAAC;AAEH,8CAA8C;AAC9C,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAAgC,CAAC;AAsDxE,uCAAuC;AACvC,eAAO,MAAM,iBAAiB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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiBzC,CAAC"}
|
|
@@ -883,31 +883,31 @@ export declare const EffectiveTradingPolicySchema: z.ZodObject<{
|
|
|
883
883
|
provider: z.ZodNativeEnum<typeof LlmProvider>;
|
|
884
884
|
modelId: z.ZodString;
|
|
885
885
|
}, "strip", z.ZodTypeAny, {
|
|
886
|
-
modelId: string;
|
|
887
886
|
provider: LlmProvider;
|
|
888
|
-
}, {
|
|
889
887
|
modelId: string;
|
|
888
|
+
}, {
|
|
890
889
|
provider: LlmProvider;
|
|
890
|
+
modelId: string;
|
|
891
891
|
}>, "many">>;
|
|
892
892
|
normalFallbackChain: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
893
893
|
provider: z.ZodNativeEnum<typeof LlmProvider>;
|
|
894
894
|
modelId: z.ZodString;
|
|
895
895
|
}, "strip", z.ZodTypeAny, {
|
|
896
|
-
modelId: string;
|
|
897
896
|
provider: LlmProvider;
|
|
898
|
-
}, {
|
|
899
897
|
modelId: string;
|
|
898
|
+
}, {
|
|
900
899
|
provider: LlmProvider;
|
|
900
|
+
modelId: string;
|
|
901
901
|
}>, "many">>;
|
|
902
902
|
advancedFallbackChain: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
903
903
|
provider: z.ZodNativeEnum<typeof LlmProvider>;
|
|
904
904
|
modelId: z.ZodString;
|
|
905
905
|
}, "strip", z.ZodTypeAny, {
|
|
906
|
-
modelId: string;
|
|
907
906
|
provider: LlmProvider;
|
|
908
|
-
}, {
|
|
909
907
|
modelId: string;
|
|
908
|
+
}, {
|
|
910
909
|
provider: LlmProvider;
|
|
910
|
+
modelId: string;
|
|
911
911
|
}>, "many">>;
|
|
912
912
|
escalateToAdvancedWhenConflicts: z.ZodDefault<z.ZodBoolean>;
|
|
913
913
|
escalateToAdvancedWhenHighExposure: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -937,16 +937,16 @@ export declare const EffectiveTradingPolicySchema: z.ZodObject<{
|
|
|
937
937
|
maxRetries: number;
|
|
938
938
|
timeoutMs: number;
|
|
939
939
|
miniFallbackChain: {
|
|
940
|
-
modelId: string;
|
|
941
940
|
provider: LlmProvider;
|
|
941
|
+
modelId: string;
|
|
942
942
|
}[];
|
|
943
943
|
normalFallbackChain: {
|
|
944
|
-
modelId: string;
|
|
945
944
|
provider: LlmProvider;
|
|
945
|
+
modelId: string;
|
|
946
946
|
}[];
|
|
947
947
|
advancedFallbackChain: {
|
|
948
|
-
modelId: string;
|
|
949
948
|
provider: LlmProvider;
|
|
949
|
+
modelId: string;
|
|
950
950
|
}[];
|
|
951
951
|
escalateToAdvancedWhenConflicts: boolean;
|
|
952
952
|
escalateToAdvancedWhenHighExposure: boolean;
|
|
@@ -968,16 +968,16 @@ export declare const EffectiveTradingPolicySchema: z.ZodObject<{
|
|
|
968
968
|
maxRetries?: number | undefined;
|
|
969
969
|
timeoutMs?: number | undefined;
|
|
970
970
|
miniFallbackChain?: {
|
|
971
|
-
modelId: string;
|
|
972
971
|
provider: LlmProvider;
|
|
972
|
+
modelId: string;
|
|
973
973
|
}[] | undefined;
|
|
974
974
|
normalFallbackChain?: {
|
|
975
|
-
modelId: string;
|
|
976
975
|
provider: LlmProvider;
|
|
976
|
+
modelId: string;
|
|
977
977
|
}[] | undefined;
|
|
978
978
|
advancedFallbackChain?: {
|
|
979
|
-
modelId: string;
|
|
980
979
|
provider: LlmProvider;
|
|
980
|
+
modelId: string;
|
|
981
981
|
}[] | undefined;
|
|
982
982
|
escalateToAdvancedWhenConflicts?: boolean | undefined;
|
|
983
983
|
escalateToAdvancedWhenHighExposure?: boolean | undefined;
|
|
@@ -1313,16 +1313,16 @@ export declare const EffectiveTradingPolicySchema: z.ZodObject<{
|
|
|
1313
1313
|
maxRetries: number;
|
|
1314
1314
|
timeoutMs: number;
|
|
1315
1315
|
miniFallbackChain: {
|
|
1316
|
-
modelId: string;
|
|
1317
1316
|
provider: LlmProvider;
|
|
1317
|
+
modelId: string;
|
|
1318
1318
|
}[];
|
|
1319
1319
|
normalFallbackChain: {
|
|
1320
|
-
modelId: string;
|
|
1321
1320
|
provider: LlmProvider;
|
|
1321
|
+
modelId: string;
|
|
1322
1322
|
}[];
|
|
1323
1323
|
advancedFallbackChain: {
|
|
1324
|
-
modelId: string;
|
|
1325
1324
|
provider: LlmProvider;
|
|
1325
|
+
modelId: string;
|
|
1326
1326
|
}[];
|
|
1327
1327
|
escalateToAdvancedWhenConflicts: boolean;
|
|
1328
1328
|
escalateToAdvancedWhenHighExposure: boolean;
|
|
@@ -1650,16 +1650,16 @@ export declare const EffectiveTradingPolicySchema: z.ZodObject<{
|
|
|
1650
1650
|
maxRetries?: number | undefined;
|
|
1651
1651
|
timeoutMs?: number | undefined;
|
|
1652
1652
|
miniFallbackChain?: {
|
|
1653
|
-
modelId: string;
|
|
1654
1653
|
provider: LlmProvider;
|
|
1654
|
+
modelId: string;
|
|
1655
1655
|
}[] | undefined;
|
|
1656
1656
|
normalFallbackChain?: {
|
|
1657
|
-
modelId: string;
|
|
1658
1657
|
provider: LlmProvider;
|
|
1658
|
+
modelId: string;
|
|
1659
1659
|
}[] | undefined;
|
|
1660
1660
|
advancedFallbackChain?: {
|
|
1661
|
-
modelId: string;
|
|
1662
1661
|
provider: LlmProvider;
|
|
1662
|
+
modelId: string;
|
|
1663
1663
|
}[] | undefined;
|
|
1664
1664
|
escalateToAdvancedWhenConflicts?: boolean | undefined;
|
|
1665
1665
|
escalateToAdvancedWhenHighExposure?: boolean | undefined;
|
|
@@ -13,31 +13,31 @@ export declare const ModelPrefsObjectSchema: z.ZodObject<{
|
|
|
13
13
|
provider: z.ZodNativeEnum<typeof LlmProvider>;
|
|
14
14
|
modelId: z.ZodString;
|
|
15
15
|
}, "strip", z.ZodTypeAny, {
|
|
16
|
-
modelId: string;
|
|
17
16
|
provider: LlmProvider;
|
|
18
|
-
}, {
|
|
19
17
|
modelId: string;
|
|
18
|
+
}, {
|
|
20
19
|
provider: LlmProvider;
|
|
20
|
+
modelId: string;
|
|
21
21
|
}>, "many">>;
|
|
22
22
|
normalFallbackChain: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
23
23
|
provider: z.ZodNativeEnum<typeof LlmProvider>;
|
|
24
24
|
modelId: z.ZodString;
|
|
25
25
|
}, "strip", z.ZodTypeAny, {
|
|
26
|
-
modelId: string;
|
|
27
26
|
provider: LlmProvider;
|
|
28
|
-
}, {
|
|
29
27
|
modelId: string;
|
|
28
|
+
}, {
|
|
30
29
|
provider: LlmProvider;
|
|
30
|
+
modelId: string;
|
|
31
31
|
}>, "many">>;
|
|
32
32
|
advancedFallbackChain: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
33
33
|
provider: z.ZodNativeEnum<typeof LlmProvider>;
|
|
34
34
|
modelId: z.ZodString;
|
|
35
35
|
}, "strip", z.ZodTypeAny, {
|
|
36
|
-
modelId: string;
|
|
37
36
|
provider: LlmProvider;
|
|
38
|
-
}, {
|
|
39
37
|
modelId: string;
|
|
38
|
+
}, {
|
|
40
39
|
provider: LlmProvider;
|
|
40
|
+
modelId: string;
|
|
41
41
|
}>, "many">>;
|
|
42
42
|
escalateToAdvancedWhenConflicts: z.ZodDefault<z.ZodBoolean>;
|
|
43
43
|
escalateToAdvancedWhenHighExposure: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -67,16 +67,16 @@ export declare const ModelPrefsObjectSchema: z.ZodObject<{
|
|
|
67
67
|
maxRetries: number;
|
|
68
68
|
timeoutMs: number;
|
|
69
69
|
miniFallbackChain: {
|
|
70
|
-
modelId: string;
|
|
71
70
|
provider: LlmProvider;
|
|
71
|
+
modelId: string;
|
|
72
72
|
}[];
|
|
73
73
|
normalFallbackChain: {
|
|
74
|
-
modelId: string;
|
|
75
74
|
provider: LlmProvider;
|
|
75
|
+
modelId: string;
|
|
76
76
|
}[];
|
|
77
77
|
advancedFallbackChain: {
|
|
78
|
-
modelId: string;
|
|
79
78
|
provider: LlmProvider;
|
|
79
|
+
modelId: string;
|
|
80
80
|
}[];
|
|
81
81
|
escalateToAdvancedWhenConflicts: boolean;
|
|
82
82
|
escalateToAdvancedWhenHighExposure: boolean;
|
|
@@ -98,16 +98,16 @@ export declare const ModelPrefsObjectSchema: z.ZodObject<{
|
|
|
98
98
|
maxRetries?: number | undefined;
|
|
99
99
|
timeoutMs?: number | undefined;
|
|
100
100
|
miniFallbackChain?: {
|
|
101
|
-
modelId: string;
|
|
102
101
|
provider: LlmProvider;
|
|
102
|
+
modelId: string;
|
|
103
103
|
}[] | undefined;
|
|
104
104
|
normalFallbackChain?: {
|
|
105
|
-
modelId: string;
|
|
106
105
|
provider: LlmProvider;
|
|
106
|
+
modelId: string;
|
|
107
107
|
}[] | undefined;
|
|
108
108
|
advancedFallbackChain?: {
|
|
109
|
-
modelId: string;
|
|
110
109
|
provider: LlmProvider;
|
|
110
|
+
modelId: string;
|
|
111
111
|
}[] | undefined;
|
|
112
112
|
escalateToAdvancedWhenConflicts?: boolean | undefined;
|
|
113
113
|
escalateToAdvancedWhenHighExposure?: boolean | undefined;
|
|
@@ -131,31 +131,31 @@ export declare const ModelPrefsSchema: z.ZodDefault<z.ZodObject<{
|
|
|
131
131
|
provider: z.ZodNativeEnum<typeof LlmProvider>;
|
|
132
132
|
modelId: z.ZodString;
|
|
133
133
|
}, "strip", z.ZodTypeAny, {
|
|
134
|
-
modelId: string;
|
|
135
134
|
provider: LlmProvider;
|
|
136
|
-
}, {
|
|
137
135
|
modelId: string;
|
|
136
|
+
}, {
|
|
138
137
|
provider: LlmProvider;
|
|
138
|
+
modelId: string;
|
|
139
139
|
}>, "many">>;
|
|
140
140
|
normalFallbackChain: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
141
141
|
provider: z.ZodNativeEnum<typeof LlmProvider>;
|
|
142
142
|
modelId: z.ZodString;
|
|
143
143
|
}, "strip", z.ZodTypeAny, {
|
|
144
|
-
modelId: string;
|
|
145
144
|
provider: LlmProvider;
|
|
146
|
-
}, {
|
|
147
145
|
modelId: string;
|
|
146
|
+
}, {
|
|
148
147
|
provider: LlmProvider;
|
|
148
|
+
modelId: string;
|
|
149
149
|
}>, "many">>;
|
|
150
150
|
advancedFallbackChain: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
151
151
|
provider: z.ZodNativeEnum<typeof LlmProvider>;
|
|
152
152
|
modelId: z.ZodString;
|
|
153
153
|
}, "strip", z.ZodTypeAny, {
|
|
154
|
-
modelId: string;
|
|
155
154
|
provider: LlmProvider;
|
|
156
|
-
}, {
|
|
157
155
|
modelId: string;
|
|
156
|
+
}, {
|
|
158
157
|
provider: LlmProvider;
|
|
158
|
+
modelId: string;
|
|
159
159
|
}>, "many">>;
|
|
160
160
|
escalateToAdvancedWhenConflicts: z.ZodDefault<z.ZodBoolean>;
|
|
161
161
|
escalateToAdvancedWhenHighExposure: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -185,16 +185,16 @@ export declare const ModelPrefsSchema: z.ZodDefault<z.ZodObject<{
|
|
|
185
185
|
maxRetries: number;
|
|
186
186
|
timeoutMs: number;
|
|
187
187
|
miniFallbackChain: {
|
|
188
|
-
modelId: string;
|
|
189
188
|
provider: LlmProvider;
|
|
189
|
+
modelId: string;
|
|
190
190
|
}[];
|
|
191
191
|
normalFallbackChain: {
|
|
192
|
-
modelId: string;
|
|
193
192
|
provider: LlmProvider;
|
|
193
|
+
modelId: string;
|
|
194
194
|
}[];
|
|
195
195
|
advancedFallbackChain: {
|
|
196
|
-
modelId: string;
|
|
197
196
|
provider: LlmProvider;
|
|
197
|
+
modelId: string;
|
|
198
198
|
}[];
|
|
199
199
|
escalateToAdvancedWhenConflicts: boolean;
|
|
200
200
|
escalateToAdvancedWhenHighExposure: boolean;
|
|
@@ -216,16 +216,16 @@ export declare const ModelPrefsSchema: z.ZodDefault<z.ZodObject<{
|
|
|
216
216
|
maxRetries?: number | undefined;
|
|
217
217
|
timeoutMs?: number | undefined;
|
|
218
218
|
miniFallbackChain?: {
|
|
219
|
-
modelId: string;
|
|
220
219
|
provider: LlmProvider;
|
|
220
|
+
modelId: string;
|
|
221
221
|
}[] | undefined;
|
|
222
222
|
normalFallbackChain?: {
|
|
223
|
-
modelId: string;
|
|
224
223
|
provider: LlmProvider;
|
|
224
|
+
modelId: string;
|
|
225
225
|
}[] | undefined;
|
|
226
226
|
advancedFallbackChain?: {
|
|
227
|
-
modelId: string;
|
|
228
227
|
provider: LlmProvider;
|
|
228
|
+
modelId: string;
|
|
229
229
|
}[] | undefined;
|
|
230
230
|
escalateToAdvancedWhenConflicts?: boolean | undefined;
|
|
231
231
|
escalateToAdvancedWhenHighExposure?: boolean | undefined;
|