@memberjunction/testing-engine 6.2.0-edge.0 → 6.2.0-edge.2
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 +4 -1
- package/dist/decision-eval/corpus.d.ts +94 -0
- package/dist/decision-eval/corpus.d.ts.map +1 -0
- package/dist/decision-eval/corpus.js +144 -0
- package/dist/decision-eval/corpus.js.map +1 -0
- package/dist/decision-eval/discovery-baseline.d.ts +62 -0
- package/dist/decision-eval/discovery-baseline.d.ts.map +1 -0
- package/dist/decision-eval/discovery-baseline.js +90 -0
- package/dist/decision-eval/discovery-baseline.js.map +1 -0
- package/dist/decision-eval/discovery-corpus.d.ts +75 -0
- package/dist/decision-eval/discovery-corpus.d.ts.map +1 -0
- package/dist/decision-eval/discovery-corpus.js +110 -0
- package/dist/decision-eval/discovery-corpus.js.map +1 -0
- package/dist/decision-eval/discovery-mapping.d.ts +18 -0
- package/dist/decision-eval/discovery-mapping.d.ts.map +1 -0
- package/dist/decision-eval/discovery-mapping.js +21 -0
- package/dist/decision-eval/discovery-mapping.js.map +1 -0
- package/dist/decision-eval/discovery-metrics.d.ts +339 -0
- package/dist/decision-eval/discovery-metrics.d.ts.map +1 -0
- package/dist/decision-eval/discovery-metrics.js +401 -0
- package/dist/decision-eval/discovery-metrics.js.map +1 -0
- package/dist/decision-eval/discovery-scorecard.d.ts +96 -0
- package/dist/decision-eval/discovery-scorecard.d.ts.map +1 -0
- package/dist/decision-eval/discovery-scorecard.js +351 -0
- package/dist/decision-eval/discovery-scorecard.js.map +1 -0
- package/dist/decision-eval/discovery-suite.d.ts +201 -0
- package/dist/decision-eval/discovery-suite.d.ts.map +1 -0
- package/dist/decision-eval/discovery-suite.js +180 -0
- package/dist/decision-eval/discovery-suite.js.map +1 -0
- package/dist/decision-eval/discovery-types.d.ts +896 -0
- package/dist/decision-eval/discovery-types.d.ts.map +1 -0
- package/dist/decision-eval/discovery-types.js +211 -0
- package/dist/decision-eval/discovery-types.js.map +1 -0
- package/dist/decision-eval/index.d.ts +18 -0
- package/dist/decision-eval/index.d.ts.map +1 -0
- package/dist/decision-eval/index.js +18 -0
- package/dist/decision-eval/index.js.map +1 -0
- package/dist/decision-eval/metrics.d.ts +330 -0
- package/dist/decision-eval/metrics.d.ts.map +1 -0
- package/dist/decision-eval/metrics.js +574 -0
- package/dist/decision-eval/metrics.js.map +1 -0
- package/dist/decision-eval/output-paths.d.ts +119 -0
- package/dist/decision-eval/output-paths.d.ts.map +1 -0
- package/dist/decision-eval/output-paths.js +258 -0
- package/dist/decision-eval/output-paths.js.map +1 -0
- package/dist/decision-eval/point-mapping.d.ts +50 -0
- package/dist/decision-eval/point-mapping.d.ts.map +1 -0
- package/dist/decision-eval/point-mapping.js +83 -0
- package/dist/decision-eval/point-mapping.js.map +1 -0
- package/dist/decision-eval/scorecard.d.ts +190 -0
- package/dist/decision-eval/scorecard.d.ts.map +1 -0
- package/dist/decision-eval/scorecard.js +384 -0
- package/dist/decision-eval/scorecard.js.map +1 -0
- package/dist/decision-eval/suite.d.ts +244 -0
- package/dist/decision-eval/suite.d.ts.map +1 -0
- package/dist/decision-eval/suite.js +238 -0
- package/dist/decision-eval/suite.js.map +1 -0
- package/dist/decision-eval/types.d.ts +993 -0
- package/dist/decision-eval/types.d.ts.map +1 -0
- package/dist/decision-eval/types.js +227 -0
- package/dist/decision-eval/types.js.map +1 -0
- package/dist/drivers/AgentEvalDriver.d.ts +30 -1
- package/dist/drivers/AgentEvalDriver.d.ts.map +1 -1
- package/dist/drivers/AgentEvalDriver.js +145 -16
- package/dist/drivers/AgentEvalDriver.js.map +1 -1
- package/dist/drivers/DecisionEvalDriver.d.ts +297 -0
- package/dist/drivers/DecisionEvalDriver.d.ts.map +1 -0
- package/dist/drivers/DecisionEvalDriver.js +716 -0
- package/dist/drivers/DecisionEvalDriver.js.map +1 -0
- package/dist/drivers/PinnedDecisionRunner.d.ts +24 -0
- package/dist/drivers/PinnedDecisionRunner.d.ts.map +1 -0
- package/dist/drivers/PinnedDecisionRunner.js +24 -0
- package/dist/drivers/PinnedDecisionRunner.js.map +1 -0
- package/dist/drivers/PromptEvalDriver.d.ts.map +1 -1
- package/dist/drivers/PromptEvalDriver.js +11 -4
- package/dist/drivers/PromptEvalDriver.js.map +1 -1
- package/dist/drivers/RubricCalibrationTestDriver.d.ts +34 -0
- package/dist/drivers/RubricCalibrationTestDriver.d.ts.map +1 -0
- package/dist/drivers/RubricCalibrationTestDriver.js +193 -0
- package/dist/drivers/RubricCalibrationTestDriver.js.map +1 -0
- package/dist/drivers/calibration.d.ts +85 -0
- package/dist/drivers/calibration.d.ts.map +1 -0
- package/dist/drivers/calibration.js +191 -0
- package/dist/drivers/calibration.js.map +1 -0
- package/dist/drivers/index.d.ts +2 -0
- package/dist/drivers/index.d.ts.map +1 -1
- package/dist/drivers/index.js +2 -0
- package/dist/drivers/index.js.map +1 -1
- package/dist/engine/TestEngine.d.ts.map +1 -1
- package/dist/engine/TestEngine.js +21 -11
- package/dist/engine/TestEngine.js.map +1 -1
- package/dist/eval/corpus.d.ts +8 -0
- package/dist/eval/corpus.d.ts.map +1 -1
- package/dist/eval/corpus.js +26 -10
- package/dist/eval/corpus.js.map +1 -1
- package/dist/eval/decision.d.ts +8 -0
- package/dist/eval/decision.d.ts.map +1 -1
- package/dist/eval/decision.js +23 -7
- package/dist/eval/decision.js.map +1 -1
- package/dist/eval/expectation.d.ts +2 -0
- package/dist/eval/expectation.d.ts.map +1 -1
- package/dist/eval/expectation.js +9 -5
- package/dist/eval/expectation.js.map +1 -1
- package/dist/eval/history.d.ts +2 -0
- package/dist/eval/history.d.ts.map +1 -1
- package/dist/eval/history.js +5 -1
- package/dist/eval/history.js.map +1 -1
- package/dist/eval/matchers.d.ts +7 -0
- package/dist/eval/matchers.d.ts.map +1 -1
- package/dist/eval/matchers.js +11 -3
- package/dist/eval/matchers.js.map +1 -1
- package/dist/eval/subAgentTrace.d.ts +8 -6
- package/dist/eval/subAgentTrace.d.ts.map +1 -1
- package/dist/eval/subAgentTrace.js +15 -11
- package/dist/eval/subAgentTrace.js.map +1 -1
- package/dist/eval/wellFormed.d.ts +2 -0
- package/dist/eval/wellFormed.d.ts.map +1 -1
- package/dist/eval/wellFormed.js +5 -1
- package/dist/eval/wellFormed.js.map +1 -1
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -1
- package/dist/oracles/AgentDecisionOracle.js +7 -7
- package/dist/oracles/DecisionJudgeOracle.d.ts +97 -0
- package/dist/oracles/DecisionJudgeOracle.d.ts.map +1 -0
- package/dist/oracles/DecisionJudgeOracle.js +230 -0
- package/dist/oracles/DecisionJudgeOracle.js.map +1 -0
- package/dist/oracles/DecisionLabelMatchOracle.d.ts +38 -0
- package/dist/oracles/DecisionLabelMatchOracle.d.ts.map +1 -0
- package/dist/oracles/DecisionLabelMatchOracle.js +96 -0
- package/dist/oracles/DecisionLabelMatchOracle.js.map +1 -0
- package/dist/oracles/DiscoveryLabelMatchOracle.d.ts +39 -0
- package/dist/oracles/DiscoveryLabelMatchOracle.d.ts.map +1 -0
- package/dist/oracles/DiscoveryLabelMatchOracle.js +88 -0
- package/dist/oracles/DiscoveryLabelMatchOracle.js.map +1 -0
- package/dist/oracles/LLMJudgeOracle.d.ts +2 -47
- package/dist/oracles/LLMJudgeOracle.d.ts.map +1 -1
- package/dist/oracles/LLMJudgeOracle.js +80 -149
- package/dist/oracles/LLMJudgeOracle.js.map +1 -1
- package/dist/oracles/RubricOracle.d.ts +51 -0
- package/dist/oracles/RubricOracle.d.ts.map +1 -0
- package/dist/oracles/RubricOracle.js +66 -0
- package/dist/oracles/RubricOracle.js.map +1 -0
- package/dist/oracles/TraceSubAgentValidatorOracle.js +3 -3
- package/dist/oracles/index.d.ts +5 -0
- package/dist/oracles/index.d.ts.map +1 -1
- package/dist/oracles/index.js +5 -0
- package/dist/oracles/index.js.map +1 -1
- package/dist/oracles/inline-rubric.d.ts +25 -0
- package/dist/oracles/inline-rubric.d.ts.map +1 -0
- package/dist/oracles/inline-rubric.js +82 -0
- package/dist/oracles/inline-rubric.js.map +1 -0
- package/dist/oracles/judge-trace.d.ts +76 -0
- package/dist/oracles/judge-trace.d.ts.map +1 -0
- package/dist/oracles/judge-trace.js +125 -0
- package/dist/oracles/judge-trace.js.map +1 -0
- package/dist/oracles/promote-criteria.d.ts +57 -0
- package/dist/oracles/promote-criteria.d.ts.map +1 -0
- package/dist/oracles/promote-criteria.js +104 -0
- package/dist/oracles/promote-criteria.js.map +1 -0
- package/dist/oracles/rubric-resolution.d.ts +69 -0
- package/dist/oracles/rubric-resolution.d.ts.map +1 -0
- package/dist/oracles/rubric-resolution.js +110 -0
- package/dist/oracles/rubric-resolution.js.map +1 -0
- package/dist/types.d.ts +4 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/cost-calculator.d.ts +34 -0
- package/dist/utils/cost-calculator.d.ts.map +1 -1
- package/dist/utils/cost-calculator.js +40 -8
- package/dist/utils/cost-calculator.js.map +1 -1
- package/dist/utils/execution-context.d.ts +6 -0
- package/dist/utils/execution-context.d.ts.map +1 -1
- package/dist/utils/execution-context.js +15 -3
- package/dist/utils/execution-context.js.map +1 -1
- package/dist/utils/result-formatter.d.ts +38 -0
- package/dist/utils/result-formatter.d.ts.map +1 -1
- package/dist/utils/result-formatter.js +74 -24
- package/dist/utils/result-formatter.js.map +1 -1
- package/dist/utils/scoring.d.ts +20 -0
- package/dist/utils/scoring.d.ts.map +1 -1
- package/dist/utils/scoring.js +35 -7
- package/dist/utils/scoring.js.map +1 -1
- package/dist/utils/variable-resolver.d.ts +20 -1
- package/dist/utils/variable-resolver.d.ts.map +1 -1
- package/dist/utils/variable-resolver.js +58 -20
- package/dist/utils/variable-resolver.js.map +1 -1
- package/package.json +12 -10
|
@@ -0,0 +1,896 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview The Decision Eval shapes for the `agent-discovery` decision (plan Task 3.1): Sage's
|
|
3
|
+
* pick of the agent that should handle a request, asked as one typed decision, and the
|
|
4
|
+
* `semantic-search` baseline that measures what `Find Candidate Agents` ranked first.
|
|
5
|
+
*
|
|
6
|
+
* - **The corpus** is `corpus.jsonl` (one request per line) and `labels.jsonl` (one label per
|
|
7
|
+
* line, several sources per request). A label is `agent` (with the agent that should handle the
|
|
8
|
+
* request) or `none` (with why no specialist should: small talk, a question the conversation
|
|
9
|
+
* manager answers directly, or a multi-agent workflow).
|
|
10
|
+
* - **A test** carries one request as its `InputDefinition` and its label as `ExpectedOutcomes`.
|
|
11
|
+
* Its `Configuration` pins the cell's model, or names the baseline, which makes no decision call.
|
|
12
|
+
*
|
|
13
|
+
* As in `types.ts`, every JSON shape is a Zod schema with its type inferred from it; the corpus
|
|
14
|
+
* keys are the corpus's own (snake_case) and the test keys are the ones the suite generator writes.
|
|
15
|
+
*
|
|
16
|
+
* @module @memberjunction/testing-engine
|
|
17
|
+
*/
|
|
18
|
+
import { z } from 'zod';
|
|
19
|
+
/** The labels a discovery request can carry: an agent should handle it, or none should. */
|
|
20
|
+
export declare const DISCOVERY_EVAL_LABELS: readonly ["agent", "none"];
|
|
21
|
+
/** A discovery label. */
|
|
22
|
+
export type DiscoveryEvalLabel = (typeof DISCOVERY_EVAL_LABELS)[number];
|
|
23
|
+
/**
|
|
24
|
+
* Why no specialist agent should handle a request:
|
|
25
|
+
* - `chat`: small talk;
|
|
26
|
+
* - `direct`: a general question the conversation manager answers itself;
|
|
27
|
+
* - `workflow`: a request that needs several agents, which the conversation manager plans.
|
|
28
|
+
*/
|
|
29
|
+
export declare const DISCOVERY_NONE_KINDS: readonly ["chat", "direct", "workflow"];
|
|
30
|
+
/** Why no specialist agent should handle a request. */
|
|
31
|
+
export type DiscoveryNoneKind = (typeof DISCOVERY_NONE_KINDS)[number];
|
|
32
|
+
/** The baselines a cell can run instead of the decision. */
|
|
33
|
+
export declare const DISCOVERY_EVAL_BASELINES: readonly ["semantic-search"];
|
|
34
|
+
/** A baseline. */
|
|
35
|
+
export type DiscoveryEvalBaseline = (typeof DISCOVERY_EVAL_BASELINES)[number];
|
|
36
|
+
/** What a run measured: the decision, or a baseline. */
|
|
37
|
+
export declare const DISCOVERY_EVAL_ARMS: readonly ["decision", "semantic-search"];
|
|
38
|
+
/** What a run measured. */
|
|
39
|
+
export type DiscoveryEvalArm = (typeof DISCOVERY_EVAL_ARMS)[number];
|
|
40
|
+
/** The suite name when neither the matrix nor the command line gives one. */
|
|
41
|
+
export declare const DEFAULT_DISCOVERY_EVAL_SUITE_NAME = "Decision Eval \u2014 Agent Discovery";
|
|
42
|
+
/** One request, as a corpus line records it. */
|
|
43
|
+
export declare const DiscoveryCorpusRequestSchema: z.ZodObject<{
|
|
44
|
+
id: z.ZodString;
|
|
45
|
+
request: z.ZodString;
|
|
46
|
+
created_at: z.ZodString;
|
|
47
|
+
}, "strip", z.ZodTypeAny, {
|
|
48
|
+
request: string;
|
|
49
|
+
id: string;
|
|
50
|
+
created_at: string;
|
|
51
|
+
}, {
|
|
52
|
+
request: string;
|
|
53
|
+
id: string;
|
|
54
|
+
created_at: string;
|
|
55
|
+
}>;
|
|
56
|
+
/** One corpus request. */
|
|
57
|
+
export type DiscoveryCorpusRequest = z.infer<typeof DiscoveryCorpusRequestSchema>;
|
|
58
|
+
/** One label for a request, from one source. A request may have several, from different sources. */
|
|
59
|
+
export declare const DiscoveryCorpusLabelSchema: z.ZodDiscriminatedUnion<"label", [z.ZodObject<{
|
|
60
|
+
source: z.ZodString;
|
|
61
|
+
label: z.ZodLiteral<"agent">;
|
|
62
|
+
agentId: z.ZodString;
|
|
63
|
+
id: z.ZodString;
|
|
64
|
+
}, "strip", z.ZodTypeAny, {
|
|
65
|
+
id: string;
|
|
66
|
+
source: string;
|
|
67
|
+
label: "agent";
|
|
68
|
+
agentId: string;
|
|
69
|
+
}, {
|
|
70
|
+
id: string;
|
|
71
|
+
source: string;
|
|
72
|
+
label: "agent";
|
|
73
|
+
agentId: string;
|
|
74
|
+
}>, z.ZodObject<{
|
|
75
|
+
source: z.ZodString;
|
|
76
|
+
label: z.ZodLiteral<"none">;
|
|
77
|
+
kind: z.ZodEnum<["chat", "direct", "workflow"]>;
|
|
78
|
+
id: z.ZodString;
|
|
79
|
+
}, "strip", z.ZodTypeAny, {
|
|
80
|
+
kind: "chat" | "direct" | "workflow";
|
|
81
|
+
id: string;
|
|
82
|
+
source: string;
|
|
83
|
+
label: "none";
|
|
84
|
+
}, {
|
|
85
|
+
kind: "chat" | "direct" | "workflow";
|
|
86
|
+
id: string;
|
|
87
|
+
source: string;
|
|
88
|
+
label: "none";
|
|
89
|
+
}>]>;
|
|
90
|
+
/** One label line. */
|
|
91
|
+
export type DiscoveryCorpusLabel = z.infer<typeof DiscoveryCorpusLabelSchema>;
|
|
92
|
+
/** A label without its request ID and source: what the request should reach. */
|
|
93
|
+
export declare const DiscoveryLabelSchema: z.ZodDiscriminatedUnion<"label", [z.ZodObject<{
|
|
94
|
+
label: z.ZodLiteral<"agent">;
|
|
95
|
+
agentId: z.ZodString;
|
|
96
|
+
}, "strip", z.ZodTypeAny, {
|
|
97
|
+
label: "agent";
|
|
98
|
+
agentId: string;
|
|
99
|
+
}, {
|
|
100
|
+
label: "agent";
|
|
101
|
+
agentId: string;
|
|
102
|
+
}>, z.ZodObject<{
|
|
103
|
+
label: z.ZodLiteral<"none">;
|
|
104
|
+
kind: z.ZodEnum<["chat", "direct", "workflow"]>;
|
|
105
|
+
}, "strip", z.ZodTypeAny, {
|
|
106
|
+
kind: "chat" | "direct" | "workflow";
|
|
107
|
+
label: "none";
|
|
108
|
+
}, {
|
|
109
|
+
kind: "chat" | "direct" | "workflow";
|
|
110
|
+
label: "none";
|
|
111
|
+
}>]>;
|
|
112
|
+
/** What a request should reach. */
|
|
113
|
+
export type DiscoveryLabel = z.infer<typeof DiscoveryLabelSchema>;
|
|
114
|
+
/** A discovery test's `Configuration`: the cell's model pinning, or its baseline. `null` reads as unset. */
|
|
115
|
+
export declare const DiscoveryEvalConfigSchema: z.ZodObject<{
|
|
116
|
+
decision: z.ZodLiteral<"agent-discovery">;
|
|
117
|
+
/** Runs this baseline instead of the decision: no decision call is made. */
|
|
118
|
+
baseline: z.ZodOptional<z.ZodNullable<z.ZodEnum<["semantic-search"]>>>;
|
|
119
|
+
/** The decision prompt. Defaults to `Default Decision`, the prompt production's discovery asks. */
|
|
120
|
+
promptName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
121
|
+
/** Pins the `MJ: AI Models` row that must answer. */
|
|
122
|
+
modelId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
123
|
+
/** Pins the vendor. */
|
|
124
|
+
vendorId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
125
|
+
/** Whether the runner may fail over. Defaults to false when the cell pins a model or vendor. */
|
|
126
|
+
failover: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
127
|
+
/** Requested sampling temperature. Recorded, not applied: see the driver. */
|
|
128
|
+
temperature: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
129
|
+
/** Requested sampling seed. Recorded, not applied: see the driver. */
|
|
130
|
+
seed: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
131
|
+
/** The oracles to run. */
|
|
132
|
+
oracles: z.ZodArray<z.ZodObject<{
|
|
133
|
+
type: z.ZodString;
|
|
134
|
+
weight: z.ZodOptional<z.ZodNumber>;
|
|
135
|
+
config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
136
|
+
}, "strip", z.ZodTypeAny, {
|
|
137
|
+
type: string;
|
|
138
|
+
weight?: number | undefined;
|
|
139
|
+
config?: Record<string, unknown> | undefined;
|
|
140
|
+
}, {
|
|
141
|
+
type: string;
|
|
142
|
+
weight?: number | undefined;
|
|
143
|
+
config?: Record<string, unknown> | undefined;
|
|
144
|
+
}>, "many">;
|
|
145
|
+
}, "strip", z.ZodTypeAny, {
|
|
146
|
+
decision: "agent-discovery";
|
|
147
|
+
oracles: {
|
|
148
|
+
type: string;
|
|
149
|
+
weight?: number | undefined;
|
|
150
|
+
config?: Record<string, unknown> | undefined;
|
|
151
|
+
}[];
|
|
152
|
+
promptName?: string | null | undefined;
|
|
153
|
+
modelId?: string | null | undefined;
|
|
154
|
+
vendorId?: string | null | undefined;
|
|
155
|
+
failover?: boolean | null | undefined;
|
|
156
|
+
temperature?: number | null | undefined;
|
|
157
|
+
seed?: number | null | undefined;
|
|
158
|
+
baseline?: "semantic-search" | null | undefined;
|
|
159
|
+
}, {
|
|
160
|
+
decision: "agent-discovery";
|
|
161
|
+
oracles: {
|
|
162
|
+
type: string;
|
|
163
|
+
weight?: number | undefined;
|
|
164
|
+
config?: Record<string, unknown> | undefined;
|
|
165
|
+
}[];
|
|
166
|
+
promptName?: string | null | undefined;
|
|
167
|
+
modelId?: string | null | undefined;
|
|
168
|
+
vendorId?: string | null | undefined;
|
|
169
|
+
failover?: boolean | null | undefined;
|
|
170
|
+
temperature?: number | null | undefined;
|
|
171
|
+
seed?: number | null | undefined;
|
|
172
|
+
baseline?: "semantic-search" | null | undefined;
|
|
173
|
+
}>;
|
|
174
|
+
/** A discovery test's `Configuration`. */
|
|
175
|
+
export type DiscoveryEvalConfig = z.infer<typeof DiscoveryEvalConfigSchema>;
|
|
176
|
+
/** A discovery test's `InputDefinition`: the request, as the user typed it. */
|
|
177
|
+
export declare const DiscoveryEvalInputSchema: z.ZodObject<{
|
|
178
|
+
request: z.ZodString;
|
|
179
|
+
}, "strip", z.ZodTypeAny, {
|
|
180
|
+
request: string;
|
|
181
|
+
}, {
|
|
182
|
+
request: string;
|
|
183
|
+
}>;
|
|
184
|
+
/** A discovery test's `InputDefinition`. */
|
|
185
|
+
export type DiscoveryEvalInput = z.infer<typeof DiscoveryEvalInputSchema>;
|
|
186
|
+
/** A discovery test's `ExpectedOutcomes`: the request's label, and where the label came from. */
|
|
187
|
+
export declare const DiscoveryEvalExpectedSchema: z.ZodDiscriminatedUnion<"label", [z.ZodObject<{
|
|
188
|
+
labelSource: z.ZodString;
|
|
189
|
+
label: z.ZodLiteral<"agent">;
|
|
190
|
+
agentId: z.ZodString;
|
|
191
|
+
}, "strip", z.ZodTypeAny, {
|
|
192
|
+
label: "agent";
|
|
193
|
+
labelSource: string;
|
|
194
|
+
agentId: string;
|
|
195
|
+
}, {
|
|
196
|
+
label: "agent";
|
|
197
|
+
labelSource: string;
|
|
198
|
+
agentId: string;
|
|
199
|
+
}>, z.ZodObject<{
|
|
200
|
+
labelSource: z.ZodString;
|
|
201
|
+
label: z.ZodLiteral<"none">;
|
|
202
|
+
kind: z.ZodEnum<["chat", "direct", "workflow"]>;
|
|
203
|
+
}, "strip", z.ZodTypeAny, {
|
|
204
|
+
kind: "chat" | "direct" | "workflow";
|
|
205
|
+
label: "none";
|
|
206
|
+
labelSource: string;
|
|
207
|
+
}, {
|
|
208
|
+
kind: "chat" | "direct" | "workflow";
|
|
209
|
+
label: "none";
|
|
210
|
+
labelSource: string;
|
|
211
|
+
}>]>;
|
|
212
|
+
/** A discovery test's `ExpectedOutcomes`. */
|
|
213
|
+
export type DiscoveryEvalExpected = z.infer<typeof DiscoveryEvalExpectedSchema>;
|
|
214
|
+
/** How the decision arm's options were reached from the catalog. */
|
|
215
|
+
export declare const DiscoveryOptionsRecordSchema: z.ZodObject<{
|
|
216
|
+
/** How many options the Choice offered. */
|
|
217
|
+
Count: z.ZodNumber;
|
|
218
|
+
/** The most options the Choice may offer. */
|
|
219
|
+
Limit: z.ZodNumber;
|
|
220
|
+
/** The permitted, directly discoverable agents, minus the conversation manager. */
|
|
221
|
+
CatalogSize: z.ZodNumber;
|
|
222
|
+
/** Catalog agents left out for having no description. */
|
|
223
|
+
WithoutDescription: z.ZodNumber;
|
|
224
|
+
/** The decision model's declared option cap, or null. */
|
|
225
|
+
DeclaredCap: z.ZodNullable<z.ZodNumber>;
|
|
226
|
+
/** The option count before the semantic search narrowed it, or null when it did not. */
|
|
227
|
+
NarrowedFrom: z.ZodNullable<z.ZodNumber>;
|
|
228
|
+
}, "strip", z.ZodTypeAny, {
|
|
229
|
+
Count: number;
|
|
230
|
+
Limit: number;
|
|
231
|
+
CatalogSize: number;
|
|
232
|
+
WithoutDescription: number;
|
|
233
|
+
DeclaredCap: number | null;
|
|
234
|
+
NarrowedFrom: number | null;
|
|
235
|
+
}, {
|
|
236
|
+
Count: number;
|
|
237
|
+
Limit: number;
|
|
238
|
+
CatalogSize: number;
|
|
239
|
+
WithoutDescription: number;
|
|
240
|
+
DeclaredCap: number | null;
|
|
241
|
+
NarrowedFrom: number | null;
|
|
242
|
+
}>;
|
|
243
|
+
/** How the decision arm's options were reached. */
|
|
244
|
+
export type DiscoveryOptionsRecord = z.infer<typeof DiscoveryOptionsRecordSchema>;
|
|
245
|
+
/** One agent the semantic search ranked, scored as `Find Candidate Agents` scores it. */
|
|
246
|
+
export declare const DiscoveryBaselineCandidateSchema: z.ZodObject<{
|
|
247
|
+
AgentId: z.ZodString;
|
|
248
|
+
AgentName: z.ZodNullable<z.ZodString>;
|
|
249
|
+
/** 1-based position in the search's results. */
|
|
250
|
+
Rank: z.ZodNumber;
|
|
251
|
+
/** The score the action reports: the larger of the semantic and lexical components, else the blended score. */
|
|
252
|
+
Score: z.ZodNumber;
|
|
253
|
+
Semantic: z.ZodNullable<z.ZodNumber>;
|
|
254
|
+
Lexical: z.ZodNullable<z.ZodNumber>;
|
|
255
|
+
/** Whether the action keeps it: semantic at or above the floor, or any lexical hit. */
|
|
256
|
+
PassesFloor: z.ZodBoolean;
|
|
257
|
+
}, "strip", z.ZodTypeAny, {
|
|
258
|
+
Score: number;
|
|
259
|
+
AgentId: string;
|
|
260
|
+
AgentName: string | null;
|
|
261
|
+
Rank: number;
|
|
262
|
+
Semantic: number | null;
|
|
263
|
+
Lexical: number | null;
|
|
264
|
+
PassesFloor: boolean;
|
|
265
|
+
}, {
|
|
266
|
+
Score: number;
|
|
267
|
+
AgentId: string;
|
|
268
|
+
AgentName: string | null;
|
|
269
|
+
Rank: number;
|
|
270
|
+
Semantic: number | null;
|
|
271
|
+
Lexical: number | null;
|
|
272
|
+
PassesFloor: boolean;
|
|
273
|
+
}>;
|
|
274
|
+
/** One ranked agent. */
|
|
275
|
+
export type DiscoveryBaselineCandidate = z.infer<typeof DiscoveryBaselineCandidateSchema>;
|
|
276
|
+
/** What the `semantic-search` baseline found. */
|
|
277
|
+
export declare const DiscoveryBaselineRecordSchema: z.ZodObject<{
|
|
278
|
+
/** The action's similarity floor. */
|
|
279
|
+
Floor: z.ZodNumber;
|
|
280
|
+
/** How many results the search was asked for. */
|
|
281
|
+
TopK: z.ZodNumber;
|
|
282
|
+
/** How many it returned. */
|
|
283
|
+
Results: z.ZodNumber;
|
|
284
|
+
/** The best-ranked candidate, floor or not, or null when the search returned none. */
|
|
285
|
+
TopRanked: z.ZodNullable<z.ZodObject<{
|
|
286
|
+
AgentId: z.ZodString;
|
|
287
|
+
AgentName: z.ZodNullable<z.ZodString>;
|
|
288
|
+
/** 1-based position in the search's results. */
|
|
289
|
+
Rank: z.ZodNumber;
|
|
290
|
+
/** The score the action reports: the larger of the semantic and lexical components, else the blended score. */
|
|
291
|
+
Score: z.ZodNumber;
|
|
292
|
+
Semantic: z.ZodNullable<z.ZodNumber>;
|
|
293
|
+
Lexical: z.ZodNullable<z.ZodNumber>;
|
|
294
|
+
/** Whether the action keeps it: semantic at or above the floor, or any lexical hit. */
|
|
295
|
+
PassesFloor: z.ZodBoolean;
|
|
296
|
+
}, "strip", z.ZodTypeAny, {
|
|
297
|
+
Score: number;
|
|
298
|
+
AgentId: string;
|
|
299
|
+
AgentName: string | null;
|
|
300
|
+
Rank: number;
|
|
301
|
+
Semantic: number | null;
|
|
302
|
+
Lexical: number | null;
|
|
303
|
+
PassesFloor: boolean;
|
|
304
|
+
}, {
|
|
305
|
+
Score: number;
|
|
306
|
+
AgentId: string;
|
|
307
|
+
AgentName: string | null;
|
|
308
|
+
Rank: number;
|
|
309
|
+
Semantic: number | null;
|
|
310
|
+
Lexical: number | null;
|
|
311
|
+
PassesFloor: boolean;
|
|
312
|
+
}>>;
|
|
313
|
+
/** The best-ranked candidate that passes the floor: the first row the action returns, or null when it returns none. */
|
|
314
|
+
TopMatch: z.ZodNullable<z.ZodObject<{
|
|
315
|
+
AgentId: z.ZodString;
|
|
316
|
+
AgentName: z.ZodNullable<z.ZodString>;
|
|
317
|
+
/** 1-based position in the search's results. */
|
|
318
|
+
Rank: z.ZodNumber;
|
|
319
|
+
/** The score the action reports: the larger of the semantic and lexical components, else the blended score. */
|
|
320
|
+
Score: z.ZodNumber;
|
|
321
|
+
Semantic: z.ZodNullable<z.ZodNumber>;
|
|
322
|
+
Lexical: z.ZodNullable<z.ZodNumber>;
|
|
323
|
+
/** Whether the action keeps it: semantic at or above the floor, or any lexical hit. */
|
|
324
|
+
PassesFloor: z.ZodBoolean;
|
|
325
|
+
}, "strip", z.ZodTypeAny, {
|
|
326
|
+
Score: number;
|
|
327
|
+
AgentId: string;
|
|
328
|
+
AgentName: string | null;
|
|
329
|
+
Rank: number;
|
|
330
|
+
Semantic: number | null;
|
|
331
|
+
Lexical: number | null;
|
|
332
|
+
PassesFloor: boolean;
|
|
333
|
+
}, {
|
|
334
|
+
Score: number;
|
|
335
|
+
AgentId: string;
|
|
336
|
+
AgentName: string | null;
|
|
337
|
+
Rank: number;
|
|
338
|
+
Semantic: number | null;
|
|
339
|
+
Lexical: number | null;
|
|
340
|
+
PassesFloor: boolean;
|
|
341
|
+
}>>;
|
|
342
|
+
}, "strip", z.ZodTypeAny, {
|
|
343
|
+
Floor: number;
|
|
344
|
+
TopK: number;
|
|
345
|
+
Results: number;
|
|
346
|
+
TopRanked: {
|
|
347
|
+
Score: number;
|
|
348
|
+
AgentId: string;
|
|
349
|
+
AgentName: string | null;
|
|
350
|
+
Rank: number;
|
|
351
|
+
Semantic: number | null;
|
|
352
|
+
Lexical: number | null;
|
|
353
|
+
PassesFloor: boolean;
|
|
354
|
+
} | null;
|
|
355
|
+
TopMatch: {
|
|
356
|
+
Score: number;
|
|
357
|
+
AgentId: string;
|
|
358
|
+
AgentName: string | null;
|
|
359
|
+
Rank: number;
|
|
360
|
+
Semantic: number | null;
|
|
361
|
+
Lexical: number | null;
|
|
362
|
+
PassesFloor: boolean;
|
|
363
|
+
} | null;
|
|
364
|
+
}, {
|
|
365
|
+
Floor: number;
|
|
366
|
+
TopK: number;
|
|
367
|
+
Results: number;
|
|
368
|
+
TopRanked: {
|
|
369
|
+
Score: number;
|
|
370
|
+
AgentId: string;
|
|
371
|
+
AgentName: string | null;
|
|
372
|
+
Rank: number;
|
|
373
|
+
Semantic: number | null;
|
|
374
|
+
Lexical: number | null;
|
|
375
|
+
PassesFloor: boolean;
|
|
376
|
+
} | null;
|
|
377
|
+
TopMatch: {
|
|
378
|
+
Score: number;
|
|
379
|
+
AgentId: string;
|
|
380
|
+
AgentName: string | null;
|
|
381
|
+
Rank: number;
|
|
382
|
+
Semantic: number | null;
|
|
383
|
+
Lexical: number | null;
|
|
384
|
+
PassesFloor: boolean;
|
|
385
|
+
} | null;
|
|
386
|
+
}>;
|
|
387
|
+
/** What the baseline found. */
|
|
388
|
+
export type DiscoveryBaselineRecord = z.infer<typeof DiscoveryBaselineRecordSchema>;
|
|
389
|
+
/**
|
|
390
|
+
* What a discovery run records as its `ActualOutput`. Both arms fill the shared fields:
|
|
391
|
+
* - `ChosenAgentId`: the Choice's agent (decision), or the action's first row (baseline);
|
|
392
|
+
* - `WouldInject`: whether production would suggest the agent: production's own verdict,
|
|
393
|
+
* `DecisionDiscoveryFromResult`, which calibrates the answers for the answering model and judges
|
|
394
|
+
* them at production's threshold, and only when the discovery finished within production's
|
|
395
|
+
* timeout (decision); or whether the action returns any row (baseline). `Confidence` and
|
|
396
|
+
* `AnyApplies` stay the model's raw answers, which calibration is fitted on.
|
|
397
|
+
*/
|
|
398
|
+
export declare const DiscoveryEvalActualOutputSchema: z.ZodObject<{
|
|
399
|
+
Decision: z.ZodLiteral<"agent-discovery">;
|
|
400
|
+
Arm: z.ZodEnum<["decision", "semantic-search"]>;
|
|
401
|
+
/** The decision prompt, or null for the baseline. */
|
|
402
|
+
PromptName: z.ZodNullable<z.ZodString>;
|
|
403
|
+
/** The decision arm's options, or null. */
|
|
404
|
+
Options: z.ZodNullable<z.ZodObject<{
|
|
405
|
+
/** How many options the Choice offered. */
|
|
406
|
+
Count: z.ZodNumber;
|
|
407
|
+
/** The most options the Choice may offer. */
|
|
408
|
+
Limit: z.ZodNumber;
|
|
409
|
+
/** The permitted, directly discoverable agents, minus the conversation manager. */
|
|
410
|
+
CatalogSize: z.ZodNumber;
|
|
411
|
+
/** Catalog agents left out for having no description. */
|
|
412
|
+
WithoutDescription: z.ZodNumber;
|
|
413
|
+
/** The decision model's declared option cap, or null. */
|
|
414
|
+
DeclaredCap: z.ZodNullable<z.ZodNumber>;
|
|
415
|
+
/** The option count before the semantic search narrowed it, or null when it did not. */
|
|
416
|
+
NarrowedFrom: z.ZodNullable<z.ZodNumber>;
|
|
417
|
+
}, "strip", z.ZodTypeAny, {
|
|
418
|
+
Count: number;
|
|
419
|
+
Limit: number;
|
|
420
|
+
CatalogSize: number;
|
|
421
|
+
WithoutDescription: number;
|
|
422
|
+
DeclaredCap: number | null;
|
|
423
|
+
NarrowedFrom: number | null;
|
|
424
|
+
}, {
|
|
425
|
+
Count: number;
|
|
426
|
+
Limit: number;
|
|
427
|
+
CatalogSize: number;
|
|
428
|
+
WithoutDescription: number;
|
|
429
|
+
DeclaredCap: number | null;
|
|
430
|
+
NarrowedFrom: number | null;
|
|
431
|
+
}>>;
|
|
432
|
+
/** For an `agent` label: whether the labelled agent was among the options (decision) or the catalog (baseline). Null otherwise. */
|
|
433
|
+
LabelledAgentOffered: z.ZodNullable<z.ZodBoolean>;
|
|
434
|
+
/** Every answer, summarized. The Choice keeps its full distribution, by agent ID. */
|
|
435
|
+
Answers: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
436
|
+
Kind: z.ZodEnum<["Likelihood", "Choice", "Score"]>;
|
|
437
|
+
Probability: z.ZodOptional<z.ZodNumber>;
|
|
438
|
+
Value: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
|
|
439
|
+
Confidence: z.ZodOptional<z.ZodNumber>;
|
|
440
|
+
Probabilities: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
441
|
+
}, "strip", z.ZodTypeAny, {
|
|
442
|
+
Kind: "Likelihood" | "Choice" | "Score";
|
|
443
|
+
Probability?: number | undefined;
|
|
444
|
+
Value?: string | number | undefined;
|
|
445
|
+
Confidence?: number | undefined;
|
|
446
|
+
Probabilities?: Record<string, number> | undefined;
|
|
447
|
+
}, {
|
|
448
|
+
Kind: "Likelihood" | "Choice" | "Score";
|
|
449
|
+
Probability?: number | undefined;
|
|
450
|
+
Value?: string | number | undefined;
|
|
451
|
+
Confidence?: number | undefined;
|
|
452
|
+
Probabilities?: Record<string, number> | undefined;
|
|
453
|
+
}>>;
|
|
454
|
+
ChosenAgentId: z.ZodNullable<z.ZodString>;
|
|
455
|
+
ChosenAgentName: z.ZodNullable<z.ZodString>;
|
|
456
|
+
/** The Choice's confidence, or null. */
|
|
457
|
+
Confidence: z.ZodNullable<z.ZodNumber>;
|
|
458
|
+
/** The Likelihood that a specialist agent should handle the request, or null. */
|
|
459
|
+
AnyApplies: z.ZodNullable<z.ZodNumber>;
|
|
460
|
+
/** Whether production would suggest the chosen agent, or null without a usable answer. */
|
|
461
|
+
WouldInject: z.ZodNullable<z.ZodBoolean>;
|
|
462
|
+
/** The calibrated threshold `WouldInject` was judged at (decision arm), or null. */
|
|
463
|
+
MinConfidence: z.ZodNullable<z.ZodNumber>;
|
|
464
|
+
/** Why nothing would be injected, or null. */
|
|
465
|
+
VerdictReason: z.ZodNullable<z.ZodString>;
|
|
466
|
+
/** The baseline's ranking, or null for the decision arm. */
|
|
467
|
+
Baseline: z.ZodNullable<z.ZodObject<{
|
|
468
|
+
/** The action's similarity floor. */
|
|
469
|
+
Floor: z.ZodNumber;
|
|
470
|
+
/** How many results the search was asked for. */
|
|
471
|
+
TopK: z.ZodNumber;
|
|
472
|
+
/** How many it returned. */
|
|
473
|
+
Results: z.ZodNumber;
|
|
474
|
+
/** The best-ranked candidate, floor or not, or null when the search returned none. */
|
|
475
|
+
TopRanked: z.ZodNullable<z.ZodObject<{
|
|
476
|
+
AgentId: z.ZodString;
|
|
477
|
+
AgentName: z.ZodNullable<z.ZodString>;
|
|
478
|
+
/** 1-based position in the search's results. */
|
|
479
|
+
Rank: z.ZodNumber;
|
|
480
|
+
/** The score the action reports: the larger of the semantic and lexical components, else the blended score. */
|
|
481
|
+
Score: z.ZodNumber;
|
|
482
|
+
Semantic: z.ZodNullable<z.ZodNumber>;
|
|
483
|
+
Lexical: z.ZodNullable<z.ZodNumber>;
|
|
484
|
+
/** Whether the action keeps it: semantic at or above the floor, or any lexical hit. */
|
|
485
|
+
PassesFloor: z.ZodBoolean;
|
|
486
|
+
}, "strip", z.ZodTypeAny, {
|
|
487
|
+
Score: number;
|
|
488
|
+
AgentId: string;
|
|
489
|
+
AgentName: string | null;
|
|
490
|
+
Rank: number;
|
|
491
|
+
Semantic: number | null;
|
|
492
|
+
Lexical: number | null;
|
|
493
|
+
PassesFloor: boolean;
|
|
494
|
+
}, {
|
|
495
|
+
Score: number;
|
|
496
|
+
AgentId: string;
|
|
497
|
+
AgentName: string | null;
|
|
498
|
+
Rank: number;
|
|
499
|
+
Semantic: number | null;
|
|
500
|
+
Lexical: number | null;
|
|
501
|
+
PassesFloor: boolean;
|
|
502
|
+
}>>;
|
|
503
|
+
/** The best-ranked candidate that passes the floor: the first row the action returns, or null when it returns none. */
|
|
504
|
+
TopMatch: z.ZodNullable<z.ZodObject<{
|
|
505
|
+
AgentId: z.ZodString;
|
|
506
|
+
AgentName: z.ZodNullable<z.ZodString>;
|
|
507
|
+
/** 1-based position in the search's results. */
|
|
508
|
+
Rank: z.ZodNumber;
|
|
509
|
+
/** The score the action reports: the larger of the semantic and lexical components, else the blended score. */
|
|
510
|
+
Score: z.ZodNumber;
|
|
511
|
+
Semantic: z.ZodNullable<z.ZodNumber>;
|
|
512
|
+
Lexical: z.ZodNullable<z.ZodNumber>;
|
|
513
|
+
/** Whether the action keeps it: semantic at or above the floor, or any lexical hit. */
|
|
514
|
+
PassesFloor: z.ZodBoolean;
|
|
515
|
+
}, "strip", z.ZodTypeAny, {
|
|
516
|
+
Score: number;
|
|
517
|
+
AgentId: string;
|
|
518
|
+
AgentName: string | null;
|
|
519
|
+
Rank: number;
|
|
520
|
+
Semantic: number | null;
|
|
521
|
+
Lexical: number | null;
|
|
522
|
+
PassesFloor: boolean;
|
|
523
|
+
}, {
|
|
524
|
+
Score: number;
|
|
525
|
+
AgentId: string;
|
|
526
|
+
AgentName: string | null;
|
|
527
|
+
Rank: number;
|
|
528
|
+
Semantic: number | null;
|
|
529
|
+
Lexical: number | null;
|
|
530
|
+
PassesFloor: boolean;
|
|
531
|
+
}>>;
|
|
532
|
+
}, "strip", z.ZodTypeAny, {
|
|
533
|
+
Floor: number;
|
|
534
|
+
TopK: number;
|
|
535
|
+
Results: number;
|
|
536
|
+
TopRanked: {
|
|
537
|
+
Score: number;
|
|
538
|
+
AgentId: string;
|
|
539
|
+
AgentName: string | null;
|
|
540
|
+
Rank: number;
|
|
541
|
+
Semantic: number | null;
|
|
542
|
+
Lexical: number | null;
|
|
543
|
+
PassesFloor: boolean;
|
|
544
|
+
} | null;
|
|
545
|
+
TopMatch: {
|
|
546
|
+
Score: number;
|
|
547
|
+
AgentId: string;
|
|
548
|
+
AgentName: string | null;
|
|
549
|
+
Rank: number;
|
|
550
|
+
Semantic: number | null;
|
|
551
|
+
Lexical: number | null;
|
|
552
|
+
PassesFloor: boolean;
|
|
553
|
+
} | null;
|
|
554
|
+
}, {
|
|
555
|
+
Floor: number;
|
|
556
|
+
TopK: number;
|
|
557
|
+
Results: number;
|
|
558
|
+
TopRanked: {
|
|
559
|
+
Score: number;
|
|
560
|
+
AgentId: string;
|
|
561
|
+
AgentName: string | null;
|
|
562
|
+
Rank: number;
|
|
563
|
+
Semantic: number | null;
|
|
564
|
+
Lexical: number | null;
|
|
565
|
+
PassesFloor: boolean;
|
|
566
|
+
} | null;
|
|
567
|
+
TopMatch: {
|
|
568
|
+
Score: number;
|
|
569
|
+
AgentId: string;
|
|
570
|
+
AgentName: string | null;
|
|
571
|
+
Rank: number;
|
|
572
|
+
Semantic: number | null;
|
|
573
|
+
Lexical: number | null;
|
|
574
|
+
PassesFloor: boolean;
|
|
575
|
+
} | null;
|
|
576
|
+
}>>;
|
|
577
|
+
/** The model record (decision arm), or null. */
|
|
578
|
+
Model: z.ZodNullable<z.ZodObject<{
|
|
579
|
+
PinnedModelId: z.ZodNullable<z.ZodString>;
|
|
580
|
+
PinnedVendorId: z.ZodNullable<z.ZodString>;
|
|
581
|
+
FailoverAllowed: z.ZodBoolean;
|
|
582
|
+
AnsweredModelId: z.ZodNullable<z.ZodString>;
|
|
583
|
+
AnsweredModelName: z.ZodNullable<z.ZodString>;
|
|
584
|
+
AnsweredVendorId: z.ZodNullable<z.ZodString>;
|
|
585
|
+
AnsweredVendorName: z.ZodNullable<z.ZodString>;
|
|
586
|
+
DriverClass: z.ZodNullable<z.ZodString>;
|
|
587
|
+
ResolvedModel: z.ZodNullable<z.ZodString>;
|
|
588
|
+
AnsweredByPinned: z.ZodNullable<z.ZodBoolean>;
|
|
589
|
+
FailedOver: z.ZodBoolean;
|
|
590
|
+
}, "strip", z.ZodTypeAny, {
|
|
591
|
+
PinnedModelId: string | null;
|
|
592
|
+
PinnedVendorId: string | null;
|
|
593
|
+
FailoverAllowed: boolean;
|
|
594
|
+
AnsweredModelId: string | null;
|
|
595
|
+
AnsweredModelName: string | null;
|
|
596
|
+
AnsweredVendorId: string | null;
|
|
597
|
+
AnsweredVendorName: string | null;
|
|
598
|
+
DriverClass: string | null;
|
|
599
|
+
ResolvedModel: string | null;
|
|
600
|
+
AnsweredByPinned: boolean | null;
|
|
601
|
+
FailedOver: boolean;
|
|
602
|
+
}, {
|
|
603
|
+
PinnedModelId: string | null;
|
|
604
|
+
PinnedVendorId: string | null;
|
|
605
|
+
FailoverAllowed: boolean;
|
|
606
|
+
AnsweredModelId: string | null;
|
|
607
|
+
AnsweredModelName: string | null;
|
|
608
|
+
AnsweredVendorId: string | null;
|
|
609
|
+
AnsweredVendorName: string | null;
|
|
610
|
+
DriverClass: string | null;
|
|
611
|
+
ResolvedModel: string | null;
|
|
612
|
+
AnsweredByPinned: boolean | null;
|
|
613
|
+
FailedOver: boolean;
|
|
614
|
+
}>>;
|
|
615
|
+
Sampling: z.ZodObject<{
|
|
616
|
+
RequestedTemperature: z.ZodNullable<z.ZodNumber>;
|
|
617
|
+
RequestedSeed: z.ZodNullable<z.ZodNumber>;
|
|
618
|
+
Applied: z.ZodBoolean;
|
|
619
|
+
Note: z.ZodNullable<z.ZodString>;
|
|
620
|
+
}, "strip", z.ZodTypeAny, {
|
|
621
|
+
RequestedTemperature: number | null;
|
|
622
|
+
RequestedSeed: number | null;
|
|
623
|
+
Applied: boolean;
|
|
624
|
+
Note: string | null;
|
|
625
|
+
}, {
|
|
626
|
+
RequestedTemperature: number | null;
|
|
627
|
+
RequestedSeed: number | null;
|
|
628
|
+
Applied: boolean;
|
|
629
|
+
Note: string | null;
|
|
630
|
+
}>;
|
|
631
|
+
/** Wall-clock time of the decision call alone, or of the search for the baseline, in milliseconds. */
|
|
632
|
+
LatencyMs: z.ZodNullable<z.ZodNumber>;
|
|
633
|
+
/**
|
|
634
|
+
* Decision arm: wall-clock time from building the options, the semantic search included, through
|
|
635
|
+
* the decision call, in milliseconds. That is the span production's discovery timeout bounds.
|
|
636
|
+
* Null for the baseline. Absent from runs recorded before it was measured.
|
|
637
|
+
*/
|
|
638
|
+
DiscoveryLatencyMs: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
639
|
+
/**
|
|
640
|
+
* Whether the discovery (`DiscoveryLatencyMs`) finished within production's timeout, or null
|
|
641
|
+
* without an answer. Production gives up at the timeout and injects nothing, so a late answer is
|
|
642
|
+
* never `WouldInject`. In runs recorded before `DiscoveryLatencyMs`, it timed the call alone.
|
|
643
|
+
*/
|
|
644
|
+
WithinProductionTimeout: z.ZodNullable<z.ZodBoolean>;
|
|
645
|
+
PromptRunId: z.ZodNullable<z.ZodString>;
|
|
646
|
+
CostUSD: z.ZodNullable<z.ZodNumber>;
|
|
647
|
+
/** Why the run produced no answer, or null. */
|
|
648
|
+
Error: z.ZodNullable<z.ZodString>;
|
|
649
|
+
}, "strip", z.ZodTypeAny, {
|
|
650
|
+
Error: string | null;
|
|
651
|
+
Decision: "agent-discovery";
|
|
652
|
+
Confidence: number | null;
|
|
653
|
+
MinConfidence: number | null;
|
|
654
|
+
PromptName: string | null;
|
|
655
|
+
Answers: Record<string, {
|
|
656
|
+
Kind: "Likelihood" | "Choice" | "Score";
|
|
657
|
+
Probability?: number | undefined;
|
|
658
|
+
Value?: string | number | undefined;
|
|
659
|
+
Confidence?: number | undefined;
|
|
660
|
+
Probabilities?: Record<string, number> | undefined;
|
|
661
|
+
}>;
|
|
662
|
+
Model: {
|
|
663
|
+
PinnedModelId: string | null;
|
|
664
|
+
PinnedVendorId: string | null;
|
|
665
|
+
FailoverAllowed: boolean;
|
|
666
|
+
AnsweredModelId: string | null;
|
|
667
|
+
AnsweredModelName: string | null;
|
|
668
|
+
AnsweredVendorId: string | null;
|
|
669
|
+
AnsweredVendorName: string | null;
|
|
670
|
+
DriverClass: string | null;
|
|
671
|
+
ResolvedModel: string | null;
|
|
672
|
+
AnsweredByPinned: boolean | null;
|
|
673
|
+
FailedOver: boolean;
|
|
674
|
+
} | null;
|
|
675
|
+
Sampling: {
|
|
676
|
+
RequestedTemperature: number | null;
|
|
677
|
+
RequestedSeed: number | null;
|
|
678
|
+
Applied: boolean;
|
|
679
|
+
Note: string | null;
|
|
680
|
+
};
|
|
681
|
+
LatencyMs: number | null;
|
|
682
|
+
PromptRunId: string | null;
|
|
683
|
+
CostUSD: number | null;
|
|
684
|
+
Arm: "decision" | "semantic-search";
|
|
685
|
+
Options: {
|
|
686
|
+
Count: number;
|
|
687
|
+
Limit: number;
|
|
688
|
+
CatalogSize: number;
|
|
689
|
+
WithoutDescription: number;
|
|
690
|
+
DeclaredCap: number | null;
|
|
691
|
+
NarrowedFrom: number | null;
|
|
692
|
+
} | null;
|
|
693
|
+
LabelledAgentOffered: boolean | null;
|
|
694
|
+
ChosenAgentId: string | null;
|
|
695
|
+
ChosenAgentName: string | null;
|
|
696
|
+
AnyApplies: number | null;
|
|
697
|
+
WouldInject: boolean | null;
|
|
698
|
+
VerdictReason: string | null;
|
|
699
|
+
Baseline: {
|
|
700
|
+
Floor: number;
|
|
701
|
+
TopK: number;
|
|
702
|
+
Results: number;
|
|
703
|
+
TopRanked: {
|
|
704
|
+
Score: number;
|
|
705
|
+
AgentId: string;
|
|
706
|
+
AgentName: string | null;
|
|
707
|
+
Rank: number;
|
|
708
|
+
Semantic: number | null;
|
|
709
|
+
Lexical: number | null;
|
|
710
|
+
PassesFloor: boolean;
|
|
711
|
+
} | null;
|
|
712
|
+
TopMatch: {
|
|
713
|
+
Score: number;
|
|
714
|
+
AgentId: string;
|
|
715
|
+
AgentName: string | null;
|
|
716
|
+
Rank: number;
|
|
717
|
+
Semantic: number | null;
|
|
718
|
+
Lexical: number | null;
|
|
719
|
+
PassesFloor: boolean;
|
|
720
|
+
} | null;
|
|
721
|
+
} | null;
|
|
722
|
+
WithinProductionTimeout: boolean | null;
|
|
723
|
+
DiscoveryLatencyMs?: number | null | undefined;
|
|
724
|
+
}, {
|
|
725
|
+
Error: string | null;
|
|
726
|
+
Decision: "agent-discovery";
|
|
727
|
+
Confidence: number | null;
|
|
728
|
+
MinConfidence: number | null;
|
|
729
|
+
PromptName: string | null;
|
|
730
|
+
Answers: Record<string, {
|
|
731
|
+
Kind: "Likelihood" | "Choice" | "Score";
|
|
732
|
+
Probability?: number | undefined;
|
|
733
|
+
Value?: string | number | undefined;
|
|
734
|
+
Confidence?: number | undefined;
|
|
735
|
+
Probabilities?: Record<string, number> | undefined;
|
|
736
|
+
}>;
|
|
737
|
+
Model: {
|
|
738
|
+
PinnedModelId: string | null;
|
|
739
|
+
PinnedVendorId: string | null;
|
|
740
|
+
FailoverAllowed: boolean;
|
|
741
|
+
AnsweredModelId: string | null;
|
|
742
|
+
AnsweredModelName: string | null;
|
|
743
|
+
AnsweredVendorId: string | null;
|
|
744
|
+
AnsweredVendorName: string | null;
|
|
745
|
+
DriverClass: string | null;
|
|
746
|
+
ResolvedModel: string | null;
|
|
747
|
+
AnsweredByPinned: boolean | null;
|
|
748
|
+
FailedOver: boolean;
|
|
749
|
+
} | null;
|
|
750
|
+
Sampling: {
|
|
751
|
+
RequestedTemperature: number | null;
|
|
752
|
+
RequestedSeed: number | null;
|
|
753
|
+
Applied: boolean;
|
|
754
|
+
Note: string | null;
|
|
755
|
+
};
|
|
756
|
+
LatencyMs: number | null;
|
|
757
|
+
PromptRunId: string | null;
|
|
758
|
+
CostUSD: number | null;
|
|
759
|
+
Arm: "decision" | "semantic-search";
|
|
760
|
+
Options: {
|
|
761
|
+
Count: number;
|
|
762
|
+
Limit: number;
|
|
763
|
+
CatalogSize: number;
|
|
764
|
+
WithoutDescription: number;
|
|
765
|
+
DeclaredCap: number | null;
|
|
766
|
+
NarrowedFrom: number | null;
|
|
767
|
+
} | null;
|
|
768
|
+
LabelledAgentOffered: boolean | null;
|
|
769
|
+
ChosenAgentId: string | null;
|
|
770
|
+
ChosenAgentName: string | null;
|
|
771
|
+
AnyApplies: number | null;
|
|
772
|
+
WouldInject: boolean | null;
|
|
773
|
+
VerdictReason: string | null;
|
|
774
|
+
Baseline: {
|
|
775
|
+
Floor: number;
|
|
776
|
+
TopK: number;
|
|
777
|
+
Results: number;
|
|
778
|
+
TopRanked: {
|
|
779
|
+
Score: number;
|
|
780
|
+
AgentId: string;
|
|
781
|
+
AgentName: string | null;
|
|
782
|
+
Rank: number;
|
|
783
|
+
Semantic: number | null;
|
|
784
|
+
Lexical: number | null;
|
|
785
|
+
PassesFloor: boolean;
|
|
786
|
+
} | null;
|
|
787
|
+
TopMatch: {
|
|
788
|
+
Score: number;
|
|
789
|
+
AgentId: string;
|
|
790
|
+
AgentName: string | null;
|
|
791
|
+
Rank: number;
|
|
792
|
+
Semantic: number | null;
|
|
793
|
+
Lexical: number | null;
|
|
794
|
+
PassesFloor: boolean;
|
|
795
|
+
} | null;
|
|
796
|
+
} | null;
|
|
797
|
+
WithinProductionTimeout: boolean | null;
|
|
798
|
+
DiscoveryLatencyMs?: number | null | undefined;
|
|
799
|
+
}>;
|
|
800
|
+
/** What a discovery run records as its `ActualOutput`. */
|
|
801
|
+
export type DiscoveryEvalActualOutput = z.infer<typeof DiscoveryEvalActualOutputSchema>;
|
|
802
|
+
/**
|
|
803
|
+
* The `discovery-label-match` oracle's `details`. `correct` is null when the run has no usable
|
|
804
|
+
* answer to judge.
|
|
805
|
+
*/
|
|
806
|
+
export declare const DiscoveryLabelMatchDetailsSchema: z.ZodObject<{
|
|
807
|
+
arm: z.ZodEnum<["decision", "semantic-search"]>;
|
|
808
|
+
label: z.ZodEnum<["agent", "none"]>;
|
|
809
|
+
kind: z.ZodNullable<z.ZodEnum<["chat", "direct", "workflow"]>>;
|
|
810
|
+
expectedAgentId: z.ZodNullable<z.ZodString>;
|
|
811
|
+
chosenAgentId: z.ZodNullable<z.ZodString>;
|
|
812
|
+
confidence: z.ZodNullable<z.ZodNumber>;
|
|
813
|
+
anyApplies: z.ZodNullable<z.ZodNumber>;
|
|
814
|
+
wouldInject: z.ZodNullable<z.ZodBoolean>;
|
|
815
|
+
/** The baseline's first row's score, or null. */
|
|
816
|
+
topScore: z.ZodNullable<z.ZodNumber>;
|
|
817
|
+
correct: z.ZodNullable<z.ZodBoolean>;
|
|
818
|
+
}, "strip", z.ZodTypeAny, {
|
|
819
|
+
kind: "chat" | "direct" | "workflow" | null;
|
|
820
|
+
label: "none" | "agent";
|
|
821
|
+
correct: boolean | null;
|
|
822
|
+
arm: "decision" | "semantic-search";
|
|
823
|
+
expectedAgentId: string | null;
|
|
824
|
+
chosenAgentId: string | null;
|
|
825
|
+
confidence: number | null;
|
|
826
|
+
anyApplies: number | null;
|
|
827
|
+
wouldInject: boolean | null;
|
|
828
|
+
topScore: number | null;
|
|
829
|
+
}, {
|
|
830
|
+
kind: "chat" | "direct" | "workflow" | null;
|
|
831
|
+
label: "none" | "agent";
|
|
832
|
+
correct: boolean | null;
|
|
833
|
+
arm: "decision" | "semantic-search";
|
|
834
|
+
expectedAgentId: string | null;
|
|
835
|
+
chosenAgentId: string | null;
|
|
836
|
+
confidence: number | null;
|
|
837
|
+
anyApplies: number | null;
|
|
838
|
+
wouldInject: boolean | null;
|
|
839
|
+
topScore: number | null;
|
|
840
|
+
}>;
|
|
841
|
+
/** The `discovery-label-match` oracle's `details`. */
|
|
842
|
+
export type DiscoveryLabelMatchDetails = z.infer<typeof DiscoveryLabelMatchDetailsSchema>;
|
|
843
|
+
/** One agent in the catalog snapshot the corpus generator writes as `agents.json`. */
|
|
844
|
+
export declare const DiscoveryCatalogAgentSchema: z.ZodObject<{
|
|
845
|
+
ID: z.ZodString;
|
|
846
|
+
Name: z.ZodString;
|
|
847
|
+
Description: z.ZodString;
|
|
848
|
+
}, "strip", z.ZodTypeAny, {
|
|
849
|
+
ID: string;
|
|
850
|
+
Name: string;
|
|
851
|
+
Description: string;
|
|
852
|
+
}, {
|
|
853
|
+
ID: string;
|
|
854
|
+
Name: string;
|
|
855
|
+
Description: string;
|
|
856
|
+
}>;
|
|
857
|
+
/** One catalog agent. */
|
|
858
|
+
export type DiscoveryCatalogAgent = z.infer<typeof DiscoveryCatalogAgentSchema>;
|
|
859
|
+
/** `agents.json`: the discoverable agents a corpus was generated from, so a run can detect catalog drift. */
|
|
860
|
+
export declare const DiscoveryCatalogSnapshotSchema: z.ZodObject<{
|
|
861
|
+
created_at: z.ZodString;
|
|
862
|
+
/** The conversation manager the catalog excludes. */
|
|
863
|
+
conversation_manager_id: z.ZodString;
|
|
864
|
+
agents: z.ZodArray<z.ZodObject<{
|
|
865
|
+
ID: z.ZodString;
|
|
866
|
+
Name: z.ZodString;
|
|
867
|
+
Description: z.ZodString;
|
|
868
|
+
}, "strip", z.ZodTypeAny, {
|
|
869
|
+
ID: string;
|
|
870
|
+
Name: string;
|
|
871
|
+
Description: string;
|
|
872
|
+
}, {
|
|
873
|
+
ID: string;
|
|
874
|
+
Name: string;
|
|
875
|
+
Description: string;
|
|
876
|
+
}>, "many">;
|
|
877
|
+
}, "strip", z.ZodTypeAny, {
|
|
878
|
+
created_at: string;
|
|
879
|
+
conversation_manager_id: string;
|
|
880
|
+
agents: {
|
|
881
|
+
ID: string;
|
|
882
|
+
Name: string;
|
|
883
|
+
Description: string;
|
|
884
|
+
}[];
|
|
885
|
+
}, {
|
|
886
|
+
created_at: string;
|
|
887
|
+
conversation_manager_id: string;
|
|
888
|
+
agents: {
|
|
889
|
+
ID: string;
|
|
890
|
+
Name: string;
|
|
891
|
+
Description: string;
|
|
892
|
+
}[];
|
|
893
|
+
}>;
|
|
894
|
+
/** `agents.json`. */
|
|
895
|
+
export type DiscoveryCatalogSnapshot = z.infer<typeof DiscoveryCatalogSnapshotSchema>;
|
|
896
|
+
//# sourceMappingURL=discovery-types.d.ts.map
|