@ego-z/contracts 0.15.17 → 0.15.19
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 +39 -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,42 @@ 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 Auto has
|
|
534
|
+
* judged it at, so a later turn never gets a lower one — except after a
|
|
535
|
+
* `fallback`, which the conversation doesn't keep.
|
|
536
|
+
*/
|
|
537
|
+
tier: AutoTier;
|
|
538
|
+
/**
|
|
539
|
+
* How the tier was picked:
|
|
540
|
+
* - `classifier`: Auto judged this turn;
|
|
541
|
+
* - `sticky`: the conversation was already at a higher tier, and the turn
|
|
542
|
+
* kept it (at `heavy`, Auto stops judging);
|
|
543
|
+
* - `fallback`: Auto couldn't judge this turn in time, so it ran at
|
|
544
|
+
* `default`. The conversation keeps its tier, so the next turn can get
|
|
545
|
+
* a lower one.
|
|
546
|
+
*/
|
|
547
|
+
source: 'classifier' | 'sticky' | 'fallback';
|
|
548
|
+
/**
|
|
549
|
+
* `false` while the owner is only trying Auto: the tier was recorded, and
|
|
550
|
+
* the project's default model answered as usual.
|
|
551
|
+
*/
|
|
552
|
+
applied: boolean;
|
|
553
|
+
}
|
|
554
|
+
|
|
519
555
|
export interface AskResponseData {
|
|
520
556
|
/** Thread the message was appended to (new or existing). */
|
|
521
557
|
threadId: string;
|
|
@@ -536,6 +572,8 @@ export interface AskResponseData {
|
|
|
536
572
|
usage: TokenUsage;
|
|
537
573
|
/** Resolved model id, e.g. `gpt-4.1-mini-2025-04-14`. */
|
|
538
574
|
model: string;
|
|
575
|
+
/** How Auto routed this turn. Absent on turns Auto didn't decide. */
|
|
576
|
+
routing?: AskRouting;
|
|
539
577
|
/** Echo of `AskRequestBody.metadata`, unchanged. */
|
|
540
578
|
metadata?: Record<string, unknown>;
|
|
541
579
|
/**
|
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
|