@ego-z/contracts 0.15.17 → 0.15.18
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/package.json +1 -1
- package/src/ask.d.ts +37 -1
- package/src/stream.d.ts +4 -0
package/package.json
CHANGED
package/src/ask.d.ts
CHANGED
|
@@ -137,7 +137,7 @@ export interface AskRequestBody {
|
|
|
137
137
|
* `"azure:auto"`).
|
|
138
138
|
*
|
|
139
139
|
* `AskResponseData.model` names the model that actually answered, as on
|
|
140
|
-
* any other turn.
|
|
140
|
+
* any other turn, and `AskResponseData.routing` the tier Auto picked.
|
|
141
141
|
*
|
|
142
142
|
* ── An explicit pick beats an Auto default ───────────────────────────
|
|
143
143
|
*
|
|
@@ -516,6 +516,40 @@ export interface AskStreamRequestBody extends AskRequestBody {
|
|
|
516
516
|
* orchestrator's return type and the SDK's decoder reference this interface,
|
|
517
517
|
* which is the structural guard against the two of them ever drifting again.
|
|
518
518
|
*/
|
|
519
|
+
/**
|
|
520
|
+
* Auto's tiers: `light` turns get less reasoning (and, when the owner picked
|
|
521
|
+
* one, a lighter model), `heavy` turns more (and a stronger model), and
|
|
522
|
+
* `default` turns run as the project is configured.
|
|
523
|
+
*/
|
|
524
|
+
export type AutoTier = 'light' | 'default' | 'heavy';
|
|
525
|
+
|
|
526
|
+
/**
|
|
527
|
+
* How Auto routed a turn — `AskResponseData.routing` and the stream's `done`
|
|
528
|
+
* event. Present only on turns Auto decided: a turn that ran Auto, or, while
|
|
529
|
+
* the owner tries Auto without applying it, a turn that picked no model.
|
|
530
|
+
*/
|
|
531
|
+
export interface AskRouting {
|
|
532
|
+
/**
|
|
533
|
+
* The tier Auto picked. A conversation keeps the highest tier it has
|
|
534
|
+
* reached, so a later turn never gets a lower one.
|
|
535
|
+
*/
|
|
536
|
+
tier: AutoTier;
|
|
537
|
+
/**
|
|
538
|
+
* How the tier was picked:
|
|
539
|
+
* - `classifier`: Auto judged this turn;
|
|
540
|
+
* - `sticky`: the conversation was already at a higher tier, and the turn
|
|
541
|
+
* kept it (at `heavy`, Auto stops judging);
|
|
542
|
+
* - `fallback`: Auto couldn't judge this turn in time, so it ran at
|
|
543
|
+
* `default`.
|
|
544
|
+
*/
|
|
545
|
+
source: 'classifier' | 'sticky' | 'fallback';
|
|
546
|
+
/**
|
|
547
|
+
* `false` while the owner is only trying Auto: the tier was recorded, and
|
|
548
|
+
* the project's default model answered as usual.
|
|
549
|
+
*/
|
|
550
|
+
applied: boolean;
|
|
551
|
+
}
|
|
552
|
+
|
|
519
553
|
export interface AskResponseData {
|
|
520
554
|
/** Thread the message was appended to (new or existing). */
|
|
521
555
|
threadId: string;
|
|
@@ -536,6 +570,8 @@ export interface AskResponseData {
|
|
|
536
570
|
usage: TokenUsage;
|
|
537
571
|
/** Resolved model id, e.g. `gpt-4.1-mini-2025-04-14`. */
|
|
538
572
|
model: string;
|
|
573
|
+
/** How Auto routed this turn. Absent on turns Auto didn't decide. */
|
|
574
|
+
routing?: AskRouting;
|
|
539
575
|
/** Echo of `AskRequestBody.metadata`, unchanged. */
|
|
540
576
|
metadata?: Record<string, unknown>;
|
|
541
577
|
/**
|
package/src/stream.d.ts
CHANGED
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
* because it inherits from `AskRequestBody`.
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
|
+
import type { AskRouting } from './ask';
|
|
14
15
|
import type { Intent, TokenUsage } from './envelope';
|
|
15
16
|
import type { AskQuestionSet } from './questions';
|
|
16
17
|
import type { InitContextItemAccepted } from './draft-conv';
|
|
@@ -317,6 +318,9 @@ export interface AskStreamDoneEvent {
|
|
|
317
318
|
toolUsed: string | null;
|
|
318
319
|
ragChunksUsed: number;
|
|
319
320
|
model: string;
|
|
321
|
+
/** How Auto routed this turn. Same semantics as `AskResponseData.routing`;
|
|
322
|
+
* absent on turns Auto didn't decide. */
|
|
323
|
+
routing?: AskRouting;
|
|
320
324
|
usage: TokenUsage;
|
|
321
325
|
/**
|
|
322
326
|
* Auto-generated conversation title (SPI_202). Same semantics as
|