@memberjunction/testing-engine 6.2.0-edge.1 → 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 +8 -1
- 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 +14 -4
- package/dist/engine/TestEngine.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/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/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/result-formatter.d.ts +5 -0
- package/dist/utils/result-formatter.d.ts.map +1 -1
- package/dist/utils/result-formatter.js +8 -2
- package/dist/utils/result-formatter.js.map +1 -1
- package/package.json +12 -10
|
@@ -0,0 +1,993 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview The Decision Eval data shapes: the corpus a suite is generated from, and what a
|
|
3
|
+
* `Decision Eval` test carries in its `Configuration`, `InputDefinition` and `ExpectedOutcomes`.
|
|
4
|
+
*
|
|
5
|
+
* Every shape that arrives as JSON (a corpus line, a label, a test record's JSON columns, a matrix)
|
|
6
|
+
* is a Zod schema, and its TypeScript type is inferred from it, so the validation and the type
|
|
7
|
+
* cannot drift apart. The corpus keys are the corpus's own (snake_case); the test keys are the
|
|
8
|
+
* ones the suite generator writes.
|
|
9
|
+
*
|
|
10
|
+
* @module @memberjunction/testing-engine
|
|
11
|
+
*/
|
|
12
|
+
import { z } from 'zod';
|
|
13
|
+
/** The labels a corpus point can carry. `continue` means the previous agent should handle the message. */
|
|
14
|
+
export declare const DECISION_EVAL_LABELS: readonly ["continue", "switch", "ambiguous"];
|
|
15
|
+
/** A label: `continue` (the positive class), `switch`, or `ambiguous` (reported apart, never scored). */
|
|
16
|
+
export type DecisionEvalLabel = (typeof DECISION_EVAL_LABELS)[number];
|
|
17
|
+
/**
|
|
18
|
+
* The decisions the harness knows how to build: conversation routing, and agent discovery (Sage's
|
|
19
|
+
* pick of the agent for a request; its shapes are in `discovery-types.ts`).
|
|
20
|
+
*/
|
|
21
|
+
export declare const DECISION_EVAL_DECISIONS: readonly ["conversation-routing", "agent-discovery"];
|
|
22
|
+
/** A decision the harness knows how to build. */
|
|
23
|
+
export type DecisionEvalDecision = (typeof DECISION_EVAL_DECISIONS)[number];
|
|
24
|
+
/**
|
|
25
|
+
* The one field every Decision Eval `Configuration` has: which decision. The driver reads it first,
|
|
26
|
+
* to choose the schemas for the rest of the test.
|
|
27
|
+
*/
|
|
28
|
+
export declare const DecisionEvalKindSchema: z.ZodObject<{
|
|
29
|
+
decision: z.ZodEnum<["conversation-routing", "agent-discovery"]>;
|
|
30
|
+
}, "strip", z.ZodTypeAny, {
|
|
31
|
+
decision: "conversation-routing" | "agent-discovery";
|
|
32
|
+
}, {
|
|
33
|
+
decision: "conversation-routing" | "agent-discovery";
|
|
34
|
+
}>;
|
|
35
|
+
/** Which state a cell sends: the production text, or Phase −1's structured object. */
|
|
36
|
+
export declare const DECISION_EVAL_STATE_LAYOUTS: readonly ["production", "structured"];
|
|
37
|
+
/** A state layout. */
|
|
38
|
+
export type DecisionEvalStateLayout = (typeof DECISION_EVAL_STATE_LAYOUTS)[number];
|
|
39
|
+
/** The label source the scorer uses unless told otherwise. */
|
|
40
|
+
export declare const DEFAULT_LABEL_SOURCE = "construction";
|
|
41
|
+
/** The decision prompt a cell runs unless it names another. */
|
|
42
|
+
export declare const DEFAULT_DECISION_PROMPT_NAME = "Default Decision";
|
|
43
|
+
/** One earlier conversation row, as a corpus point records it. */
|
|
44
|
+
export declare const DecisionCorpusHistoryRowSchema: z.ZodObject<{
|
|
45
|
+
id: z.ZodString;
|
|
46
|
+
role: z.ZodEnum<["User", "AI"]>;
|
|
47
|
+
message: z.ZodString;
|
|
48
|
+
agent_id: z.ZodNullable<z.ZodString>;
|
|
49
|
+
agent_name: z.ZodNullable<z.ZodString>;
|
|
50
|
+
created_at: z.ZodString;
|
|
51
|
+
status: z.ZodString;
|
|
52
|
+
}, "strip", z.ZodTypeAny, {
|
|
53
|
+
message: string;
|
|
54
|
+
id: string;
|
|
55
|
+
status: string;
|
|
56
|
+
role: "User" | "AI";
|
|
57
|
+
agent_id: string | null;
|
|
58
|
+
agent_name: string | null;
|
|
59
|
+
created_at: string;
|
|
60
|
+
}, {
|
|
61
|
+
message: string;
|
|
62
|
+
id: string;
|
|
63
|
+
status: string;
|
|
64
|
+
role: "User" | "AI";
|
|
65
|
+
agent_id: string | null;
|
|
66
|
+
agent_name: string | null;
|
|
67
|
+
created_at: string;
|
|
68
|
+
}>;
|
|
69
|
+
/** One artifact the previous agent produced, with its versions newest first. */
|
|
70
|
+
export declare const DecisionCorpusArtifactSchema: z.ZodObject<{
|
|
71
|
+
artifactId: z.ZodString;
|
|
72
|
+
artifactName: z.ZodString;
|
|
73
|
+
artifactType: z.ZodString;
|
|
74
|
+
versions: z.ZodArray<z.ZodObject<{
|
|
75
|
+
versionId: z.ZodString;
|
|
76
|
+
versionNumber: z.ZodNumber;
|
|
77
|
+
versionName: z.ZodNullable<z.ZodString>;
|
|
78
|
+
}, "strip", z.ZodTypeAny, {
|
|
79
|
+
versionId: string;
|
|
80
|
+
versionNumber: number;
|
|
81
|
+
versionName: string | null;
|
|
82
|
+
}, {
|
|
83
|
+
versionId: string;
|
|
84
|
+
versionNumber: number;
|
|
85
|
+
versionName: string | null;
|
|
86
|
+
}>, "many">;
|
|
87
|
+
}, "strip", z.ZodTypeAny, {
|
|
88
|
+
artifactId: string;
|
|
89
|
+
artifactName: string;
|
|
90
|
+
artifactType: string;
|
|
91
|
+
versions: {
|
|
92
|
+
versionId: string;
|
|
93
|
+
versionNumber: number;
|
|
94
|
+
versionName: string | null;
|
|
95
|
+
}[];
|
|
96
|
+
}, {
|
|
97
|
+
artifactId: string;
|
|
98
|
+
artifactName: string;
|
|
99
|
+
artifactType: string;
|
|
100
|
+
versions: {
|
|
101
|
+
versionId: string;
|
|
102
|
+
versionNumber: number;
|
|
103
|
+
versionName: string | null;
|
|
104
|
+
}[];
|
|
105
|
+
}>;
|
|
106
|
+
/**
|
|
107
|
+
* One decision point: a user's new message, the agent that answered last, and the conversation
|
|
108
|
+
* before it. The corpus's other fields (`fast_path`, `next_handler` and the two hindsight fields)
|
|
109
|
+
* are not used, and parsing drops them, so they never reach a test record.
|
|
110
|
+
*/
|
|
111
|
+
export declare const DecisionCorpusPointSchema: z.ZodObject<{
|
|
112
|
+
id: z.ZodString;
|
|
113
|
+
source: z.ZodString;
|
|
114
|
+
conversation_id: z.ZodString;
|
|
115
|
+
created_at: z.ZodString;
|
|
116
|
+
latest_message: z.ZodString;
|
|
117
|
+
previous_agent: z.ZodObject<{
|
|
118
|
+
id: z.ZodString;
|
|
119
|
+
name: z.ZodString;
|
|
120
|
+
description: z.ZodString;
|
|
121
|
+
}, "strip", z.ZodTypeAny, {
|
|
122
|
+
name: string;
|
|
123
|
+
id: string;
|
|
124
|
+
description: string;
|
|
125
|
+
}, {
|
|
126
|
+
name: string;
|
|
127
|
+
id: string;
|
|
128
|
+
description: string;
|
|
129
|
+
}>;
|
|
130
|
+
history: z.ZodArray<z.ZodObject<{
|
|
131
|
+
id: z.ZodString;
|
|
132
|
+
role: z.ZodEnum<["User", "AI"]>;
|
|
133
|
+
message: z.ZodString;
|
|
134
|
+
agent_id: z.ZodNullable<z.ZodString>;
|
|
135
|
+
agent_name: z.ZodNullable<z.ZodString>;
|
|
136
|
+
created_at: z.ZodString;
|
|
137
|
+
status: z.ZodString;
|
|
138
|
+
}, "strip", z.ZodTypeAny, {
|
|
139
|
+
message: string;
|
|
140
|
+
id: string;
|
|
141
|
+
status: string;
|
|
142
|
+
role: "User" | "AI";
|
|
143
|
+
agent_id: string | null;
|
|
144
|
+
agent_name: string | null;
|
|
145
|
+
created_at: string;
|
|
146
|
+
}, {
|
|
147
|
+
message: string;
|
|
148
|
+
id: string;
|
|
149
|
+
status: string;
|
|
150
|
+
role: "User" | "AI";
|
|
151
|
+
agent_id: string | null;
|
|
152
|
+
agent_name: string | null;
|
|
153
|
+
created_at: string;
|
|
154
|
+
}>, "many">;
|
|
155
|
+
artifacts: z.ZodArray<z.ZodObject<{
|
|
156
|
+
artifactId: z.ZodString;
|
|
157
|
+
artifactName: z.ZodString;
|
|
158
|
+
artifactType: z.ZodString;
|
|
159
|
+
versions: z.ZodArray<z.ZodObject<{
|
|
160
|
+
versionId: z.ZodString;
|
|
161
|
+
versionNumber: z.ZodNumber;
|
|
162
|
+
versionName: z.ZodNullable<z.ZodString>;
|
|
163
|
+
}, "strip", z.ZodTypeAny, {
|
|
164
|
+
versionId: string;
|
|
165
|
+
versionNumber: number;
|
|
166
|
+
versionName: string | null;
|
|
167
|
+
}, {
|
|
168
|
+
versionId: string;
|
|
169
|
+
versionNumber: number;
|
|
170
|
+
versionName: string | null;
|
|
171
|
+
}>, "many">;
|
|
172
|
+
}, "strip", z.ZodTypeAny, {
|
|
173
|
+
artifactId: string;
|
|
174
|
+
artifactName: string;
|
|
175
|
+
artifactType: string;
|
|
176
|
+
versions: {
|
|
177
|
+
versionId: string;
|
|
178
|
+
versionNumber: number;
|
|
179
|
+
versionName: string | null;
|
|
180
|
+
}[];
|
|
181
|
+
}, {
|
|
182
|
+
artifactId: string;
|
|
183
|
+
artifactName: string;
|
|
184
|
+
artifactType: string;
|
|
185
|
+
versions: {
|
|
186
|
+
versionId: string;
|
|
187
|
+
versionNumber: number;
|
|
188
|
+
versionName: string | null;
|
|
189
|
+
}[];
|
|
190
|
+
}>, "many">;
|
|
191
|
+
}, "strip", z.ZodTypeAny, {
|
|
192
|
+
id: string;
|
|
193
|
+
created_at: string;
|
|
194
|
+
source: string;
|
|
195
|
+
conversation_id: string;
|
|
196
|
+
latest_message: string;
|
|
197
|
+
previous_agent: {
|
|
198
|
+
name: string;
|
|
199
|
+
id: string;
|
|
200
|
+
description: string;
|
|
201
|
+
};
|
|
202
|
+
history: {
|
|
203
|
+
message: string;
|
|
204
|
+
id: string;
|
|
205
|
+
status: string;
|
|
206
|
+
role: "User" | "AI";
|
|
207
|
+
agent_id: string | null;
|
|
208
|
+
agent_name: string | null;
|
|
209
|
+
created_at: string;
|
|
210
|
+
}[];
|
|
211
|
+
artifacts: {
|
|
212
|
+
artifactId: string;
|
|
213
|
+
artifactName: string;
|
|
214
|
+
artifactType: string;
|
|
215
|
+
versions: {
|
|
216
|
+
versionId: string;
|
|
217
|
+
versionNumber: number;
|
|
218
|
+
versionName: string | null;
|
|
219
|
+
}[];
|
|
220
|
+
}[];
|
|
221
|
+
}, {
|
|
222
|
+
id: string;
|
|
223
|
+
created_at: string;
|
|
224
|
+
source: string;
|
|
225
|
+
conversation_id: string;
|
|
226
|
+
latest_message: string;
|
|
227
|
+
previous_agent: {
|
|
228
|
+
name: string;
|
|
229
|
+
id: string;
|
|
230
|
+
description: string;
|
|
231
|
+
};
|
|
232
|
+
history: {
|
|
233
|
+
message: string;
|
|
234
|
+
id: string;
|
|
235
|
+
status: string;
|
|
236
|
+
role: "User" | "AI";
|
|
237
|
+
agent_id: string | null;
|
|
238
|
+
agent_name: string | null;
|
|
239
|
+
created_at: string;
|
|
240
|
+
}[];
|
|
241
|
+
artifacts: {
|
|
242
|
+
artifactId: string;
|
|
243
|
+
artifactName: string;
|
|
244
|
+
artifactType: string;
|
|
245
|
+
versions: {
|
|
246
|
+
versionId: string;
|
|
247
|
+
versionNumber: number;
|
|
248
|
+
versionName: string | null;
|
|
249
|
+
}[];
|
|
250
|
+
}[];
|
|
251
|
+
}>;
|
|
252
|
+
/** One decision point. */
|
|
253
|
+
export type DecisionCorpusPoint = z.infer<typeof DecisionCorpusPointSchema>;
|
|
254
|
+
/** One corpus history row. */
|
|
255
|
+
export type DecisionCorpusHistoryRow = z.infer<typeof DecisionCorpusHistoryRowSchema>;
|
|
256
|
+
/** One corpus artifact. */
|
|
257
|
+
export type DecisionCorpusArtifact = z.infer<typeof DecisionCorpusArtifactSchema>;
|
|
258
|
+
/** One label for a point, from one source. A point has several, from different sources. */
|
|
259
|
+
export declare const DecisionCorpusLabelSchema: z.ZodObject<{
|
|
260
|
+
id: z.ZodString;
|
|
261
|
+
label: z.ZodEnum<["continue", "switch", "ambiguous"]>;
|
|
262
|
+
source: z.ZodString;
|
|
263
|
+
note: z.ZodString;
|
|
264
|
+
}, "strip", z.ZodTypeAny, {
|
|
265
|
+
id: string;
|
|
266
|
+
source: string;
|
|
267
|
+
label: "continue" | "switch" | "ambiguous";
|
|
268
|
+
note: string;
|
|
269
|
+
}, {
|
|
270
|
+
id: string;
|
|
271
|
+
source: string;
|
|
272
|
+
label: "continue" | "switch" | "ambiguous";
|
|
273
|
+
note: string;
|
|
274
|
+
}>;
|
|
275
|
+
/** One label line. */
|
|
276
|
+
export type DecisionCorpusLabel = z.infer<typeof DecisionCorpusLabelSchema>;
|
|
277
|
+
/** One oracle a Decision Eval test runs, as its `Configuration` lists it. */
|
|
278
|
+
export declare const DecisionEvalOracleSpecSchema: z.ZodObject<{
|
|
279
|
+
type: z.ZodString;
|
|
280
|
+
weight: z.ZodOptional<z.ZodNumber>;
|
|
281
|
+
config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
282
|
+
}, "strip", z.ZodTypeAny, {
|
|
283
|
+
type: string;
|
|
284
|
+
weight?: number | undefined;
|
|
285
|
+
config?: Record<string, unknown> | undefined;
|
|
286
|
+
}, {
|
|
287
|
+
type: string;
|
|
288
|
+
weight?: number | undefined;
|
|
289
|
+
config?: Record<string, unknown> | undefined;
|
|
290
|
+
}>;
|
|
291
|
+
/**
|
|
292
|
+
* A Decision Eval test's `Configuration`: which decision, which state layout, and the cell's model
|
|
293
|
+
* pinning. `null` reads as unset, as mj-sync may write it.
|
|
294
|
+
*/
|
|
295
|
+
export declare const DecisionEvalConfigSchema: z.ZodObject<{
|
|
296
|
+
/** Which decision builder. A discovery test has its own schema (`DiscoveryEvalConfigSchema`). */
|
|
297
|
+
decision: z.ZodLiteral<"conversation-routing">;
|
|
298
|
+
/** `production` sends `BuildRoutingState`; `structured` sends `BuildRoutingStateStructured`. */
|
|
299
|
+
stateLayout: z.ZodEnum<["production", "structured"]>;
|
|
300
|
+
/** The decision prompt. Defaults to {@link DEFAULT_DECISION_PROMPT_NAME}. */
|
|
301
|
+
promptName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
302
|
+
/** Pins the `MJ: AI Models` row that must answer. */
|
|
303
|
+
modelId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
304
|
+
/** Pins the vendor. */
|
|
305
|
+
vendorId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
306
|
+
/** Whether the runner may fail over. Defaults to false when the cell pins a model or vendor. */
|
|
307
|
+
failover: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
308
|
+
/** Requested sampling temperature. Recorded; see the driver for whether it reaches the model. */
|
|
309
|
+
temperature: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
310
|
+
/** Requested sampling seed. Recorded; see the driver for whether it reaches the model. */
|
|
311
|
+
seed: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
312
|
+
/** The oracles to run. */
|
|
313
|
+
oracles: z.ZodArray<z.ZodObject<{
|
|
314
|
+
type: z.ZodString;
|
|
315
|
+
weight: z.ZodOptional<z.ZodNumber>;
|
|
316
|
+
config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
317
|
+
}, "strip", z.ZodTypeAny, {
|
|
318
|
+
type: string;
|
|
319
|
+
weight?: number | undefined;
|
|
320
|
+
config?: Record<string, unknown> | undefined;
|
|
321
|
+
}, {
|
|
322
|
+
type: string;
|
|
323
|
+
weight?: number | undefined;
|
|
324
|
+
config?: Record<string, unknown> | undefined;
|
|
325
|
+
}>, "many">;
|
|
326
|
+
}, "strip", z.ZodTypeAny, {
|
|
327
|
+
decision: "conversation-routing";
|
|
328
|
+
stateLayout: "production" | "structured";
|
|
329
|
+
oracles: {
|
|
330
|
+
type: string;
|
|
331
|
+
weight?: number | undefined;
|
|
332
|
+
config?: Record<string, unknown> | undefined;
|
|
333
|
+
}[];
|
|
334
|
+
promptName?: string | null | undefined;
|
|
335
|
+
modelId?: string | null | undefined;
|
|
336
|
+
vendorId?: string | null | undefined;
|
|
337
|
+
failover?: boolean | null | undefined;
|
|
338
|
+
temperature?: number | null | undefined;
|
|
339
|
+
seed?: number | null | undefined;
|
|
340
|
+
}, {
|
|
341
|
+
decision: "conversation-routing";
|
|
342
|
+
stateLayout: "production" | "structured";
|
|
343
|
+
oracles: {
|
|
344
|
+
type: string;
|
|
345
|
+
weight?: number | undefined;
|
|
346
|
+
config?: Record<string, unknown> | undefined;
|
|
347
|
+
}[];
|
|
348
|
+
promptName?: string | null | undefined;
|
|
349
|
+
modelId?: string | null | undefined;
|
|
350
|
+
vendorId?: string | null | undefined;
|
|
351
|
+
failover?: boolean | null | undefined;
|
|
352
|
+
temperature?: number | null | undefined;
|
|
353
|
+
seed?: number | null | undefined;
|
|
354
|
+
}>;
|
|
355
|
+
/** A Decision Eval test's `Configuration`. */
|
|
356
|
+
export type DecisionEvalConfig = z.infer<typeof DecisionEvalConfigSchema>;
|
|
357
|
+
/** A Decision Eval test's `InputDefinition`: one corpus point. */
|
|
358
|
+
export declare const DecisionEvalInputSchema: z.ZodObject<{
|
|
359
|
+
point: z.ZodObject<{
|
|
360
|
+
id: z.ZodString;
|
|
361
|
+
source: z.ZodString;
|
|
362
|
+
conversation_id: z.ZodString;
|
|
363
|
+
created_at: z.ZodString;
|
|
364
|
+
latest_message: z.ZodString;
|
|
365
|
+
previous_agent: z.ZodObject<{
|
|
366
|
+
id: z.ZodString;
|
|
367
|
+
name: z.ZodString;
|
|
368
|
+
description: z.ZodString;
|
|
369
|
+
}, "strip", z.ZodTypeAny, {
|
|
370
|
+
name: string;
|
|
371
|
+
id: string;
|
|
372
|
+
description: string;
|
|
373
|
+
}, {
|
|
374
|
+
name: string;
|
|
375
|
+
id: string;
|
|
376
|
+
description: string;
|
|
377
|
+
}>;
|
|
378
|
+
history: z.ZodArray<z.ZodObject<{
|
|
379
|
+
id: z.ZodString;
|
|
380
|
+
role: z.ZodEnum<["User", "AI"]>;
|
|
381
|
+
message: z.ZodString;
|
|
382
|
+
agent_id: z.ZodNullable<z.ZodString>;
|
|
383
|
+
agent_name: z.ZodNullable<z.ZodString>;
|
|
384
|
+
created_at: z.ZodString;
|
|
385
|
+
status: z.ZodString;
|
|
386
|
+
}, "strip", z.ZodTypeAny, {
|
|
387
|
+
message: string;
|
|
388
|
+
id: string;
|
|
389
|
+
status: string;
|
|
390
|
+
role: "User" | "AI";
|
|
391
|
+
agent_id: string | null;
|
|
392
|
+
agent_name: string | null;
|
|
393
|
+
created_at: string;
|
|
394
|
+
}, {
|
|
395
|
+
message: string;
|
|
396
|
+
id: string;
|
|
397
|
+
status: string;
|
|
398
|
+
role: "User" | "AI";
|
|
399
|
+
agent_id: string | null;
|
|
400
|
+
agent_name: string | null;
|
|
401
|
+
created_at: string;
|
|
402
|
+
}>, "many">;
|
|
403
|
+
artifacts: z.ZodArray<z.ZodObject<{
|
|
404
|
+
artifactId: z.ZodString;
|
|
405
|
+
artifactName: z.ZodString;
|
|
406
|
+
artifactType: z.ZodString;
|
|
407
|
+
versions: z.ZodArray<z.ZodObject<{
|
|
408
|
+
versionId: z.ZodString;
|
|
409
|
+
versionNumber: z.ZodNumber;
|
|
410
|
+
versionName: z.ZodNullable<z.ZodString>;
|
|
411
|
+
}, "strip", z.ZodTypeAny, {
|
|
412
|
+
versionId: string;
|
|
413
|
+
versionNumber: number;
|
|
414
|
+
versionName: string | null;
|
|
415
|
+
}, {
|
|
416
|
+
versionId: string;
|
|
417
|
+
versionNumber: number;
|
|
418
|
+
versionName: string | null;
|
|
419
|
+
}>, "many">;
|
|
420
|
+
}, "strip", z.ZodTypeAny, {
|
|
421
|
+
artifactId: string;
|
|
422
|
+
artifactName: string;
|
|
423
|
+
artifactType: string;
|
|
424
|
+
versions: {
|
|
425
|
+
versionId: string;
|
|
426
|
+
versionNumber: number;
|
|
427
|
+
versionName: string | null;
|
|
428
|
+
}[];
|
|
429
|
+
}, {
|
|
430
|
+
artifactId: string;
|
|
431
|
+
artifactName: string;
|
|
432
|
+
artifactType: string;
|
|
433
|
+
versions: {
|
|
434
|
+
versionId: string;
|
|
435
|
+
versionNumber: number;
|
|
436
|
+
versionName: string | null;
|
|
437
|
+
}[];
|
|
438
|
+
}>, "many">;
|
|
439
|
+
}, "strip", z.ZodTypeAny, {
|
|
440
|
+
id: string;
|
|
441
|
+
created_at: string;
|
|
442
|
+
source: string;
|
|
443
|
+
conversation_id: string;
|
|
444
|
+
latest_message: string;
|
|
445
|
+
previous_agent: {
|
|
446
|
+
name: string;
|
|
447
|
+
id: string;
|
|
448
|
+
description: string;
|
|
449
|
+
};
|
|
450
|
+
history: {
|
|
451
|
+
message: string;
|
|
452
|
+
id: string;
|
|
453
|
+
status: string;
|
|
454
|
+
role: "User" | "AI";
|
|
455
|
+
agent_id: string | null;
|
|
456
|
+
agent_name: string | null;
|
|
457
|
+
created_at: string;
|
|
458
|
+
}[];
|
|
459
|
+
artifacts: {
|
|
460
|
+
artifactId: string;
|
|
461
|
+
artifactName: string;
|
|
462
|
+
artifactType: string;
|
|
463
|
+
versions: {
|
|
464
|
+
versionId: string;
|
|
465
|
+
versionNumber: number;
|
|
466
|
+
versionName: string | null;
|
|
467
|
+
}[];
|
|
468
|
+
}[];
|
|
469
|
+
}, {
|
|
470
|
+
id: string;
|
|
471
|
+
created_at: string;
|
|
472
|
+
source: string;
|
|
473
|
+
conversation_id: string;
|
|
474
|
+
latest_message: string;
|
|
475
|
+
previous_agent: {
|
|
476
|
+
name: string;
|
|
477
|
+
id: string;
|
|
478
|
+
description: string;
|
|
479
|
+
};
|
|
480
|
+
history: {
|
|
481
|
+
message: string;
|
|
482
|
+
id: string;
|
|
483
|
+
status: string;
|
|
484
|
+
role: "User" | "AI";
|
|
485
|
+
agent_id: string | null;
|
|
486
|
+
agent_name: string | null;
|
|
487
|
+
created_at: string;
|
|
488
|
+
}[];
|
|
489
|
+
artifacts: {
|
|
490
|
+
artifactId: string;
|
|
491
|
+
artifactName: string;
|
|
492
|
+
artifactType: string;
|
|
493
|
+
versions: {
|
|
494
|
+
versionId: string;
|
|
495
|
+
versionNumber: number;
|
|
496
|
+
versionName: string | null;
|
|
497
|
+
}[];
|
|
498
|
+
}[];
|
|
499
|
+
}>;
|
|
500
|
+
}, "strip", z.ZodTypeAny, {
|
|
501
|
+
point: {
|
|
502
|
+
id: string;
|
|
503
|
+
created_at: string;
|
|
504
|
+
source: string;
|
|
505
|
+
conversation_id: string;
|
|
506
|
+
latest_message: string;
|
|
507
|
+
previous_agent: {
|
|
508
|
+
name: string;
|
|
509
|
+
id: string;
|
|
510
|
+
description: string;
|
|
511
|
+
};
|
|
512
|
+
history: {
|
|
513
|
+
message: string;
|
|
514
|
+
id: string;
|
|
515
|
+
status: string;
|
|
516
|
+
role: "User" | "AI";
|
|
517
|
+
agent_id: string | null;
|
|
518
|
+
agent_name: string | null;
|
|
519
|
+
created_at: string;
|
|
520
|
+
}[];
|
|
521
|
+
artifacts: {
|
|
522
|
+
artifactId: string;
|
|
523
|
+
artifactName: string;
|
|
524
|
+
artifactType: string;
|
|
525
|
+
versions: {
|
|
526
|
+
versionId: string;
|
|
527
|
+
versionNumber: number;
|
|
528
|
+
versionName: string | null;
|
|
529
|
+
}[];
|
|
530
|
+
}[];
|
|
531
|
+
};
|
|
532
|
+
}, {
|
|
533
|
+
point: {
|
|
534
|
+
id: string;
|
|
535
|
+
created_at: string;
|
|
536
|
+
source: string;
|
|
537
|
+
conversation_id: string;
|
|
538
|
+
latest_message: string;
|
|
539
|
+
previous_agent: {
|
|
540
|
+
name: string;
|
|
541
|
+
id: string;
|
|
542
|
+
description: string;
|
|
543
|
+
};
|
|
544
|
+
history: {
|
|
545
|
+
message: string;
|
|
546
|
+
id: string;
|
|
547
|
+
status: string;
|
|
548
|
+
role: "User" | "AI";
|
|
549
|
+
agent_id: string | null;
|
|
550
|
+
agent_name: string | null;
|
|
551
|
+
created_at: string;
|
|
552
|
+
}[];
|
|
553
|
+
artifacts: {
|
|
554
|
+
artifactId: string;
|
|
555
|
+
artifactName: string;
|
|
556
|
+
artifactType: string;
|
|
557
|
+
versions: {
|
|
558
|
+
versionId: string;
|
|
559
|
+
versionNumber: number;
|
|
560
|
+
versionName: string | null;
|
|
561
|
+
}[];
|
|
562
|
+
}[];
|
|
563
|
+
};
|
|
564
|
+
}>;
|
|
565
|
+
/** A Decision Eval test's `InputDefinition`. */
|
|
566
|
+
export type DecisionEvalInput = z.infer<typeof DecisionEvalInputSchema>;
|
|
567
|
+
/** A Decision Eval test's `ExpectedOutcomes`: the point's label, and where the label came from. */
|
|
568
|
+
export declare const DecisionEvalExpectedSchema: z.ZodObject<{
|
|
569
|
+
label: z.ZodEnum<["continue", "switch", "ambiguous"]>;
|
|
570
|
+
labelSource: z.ZodString;
|
|
571
|
+
}, "strip", z.ZodTypeAny, {
|
|
572
|
+
label: "continue" | "switch" | "ambiguous";
|
|
573
|
+
labelSource: string;
|
|
574
|
+
}, {
|
|
575
|
+
label: "continue" | "switch" | "ambiguous";
|
|
576
|
+
labelSource: string;
|
|
577
|
+
}>;
|
|
578
|
+
/** A Decision Eval test's `ExpectedOutcomes`. */
|
|
579
|
+
export type DecisionEvalExpected = z.infer<typeof DecisionEvalExpectedSchema>;
|
|
580
|
+
/** One answer, summarized: a Likelihood's probability, or a Choice's or Score's value, confidence and distribution. */
|
|
581
|
+
export declare const DecisionEvalAnswerSummarySchema: z.ZodObject<{
|
|
582
|
+
Kind: z.ZodEnum<["Likelihood", "Choice", "Score"]>;
|
|
583
|
+
Probability: z.ZodOptional<z.ZodNumber>;
|
|
584
|
+
Value: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
|
|
585
|
+
Confidence: z.ZodOptional<z.ZodNumber>;
|
|
586
|
+
Probabilities: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
587
|
+
}, "strip", z.ZodTypeAny, {
|
|
588
|
+
Kind: "Likelihood" | "Choice" | "Score";
|
|
589
|
+
Probability?: number | undefined;
|
|
590
|
+
Value?: string | number | undefined;
|
|
591
|
+
Confidence?: number | undefined;
|
|
592
|
+
Probabilities?: Record<string, number> | undefined;
|
|
593
|
+
}, {
|
|
594
|
+
Kind: "Likelihood" | "Choice" | "Score";
|
|
595
|
+
Probability?: number | undefined;
|
|
596
|
+
Value?: string | number | undefined;
|
|
597
|
+
Confidence?: number | undefined;
|
|
598
|
+
Probabilities?: Record<string, number> | undefined;
|
|
599
|
+
}>;
|
|
600
|
+
/** One summarized answer. */
|
|
601
|
+
export type DecisionEvalAnswerSummary = z.infer<typeof DecisionEvalAnswerSummarySchema>;
|
|
602
|
+
/** Which model a run was pinned to, which one answered, and whether they match. */
|
|
603
|
+
export declare const DecisionEvalModelRecordSchema: z.ZodObject<{
|
|
604
|
+
PinnedModelId: z.ZodNullable<z.ZodString>;
|
|
605
|
+
PinnedVendorId: z.ZodNullable<z.ZodString>;
|
|
606
|
+
FailoverAllowed: z.ZodBoolean;
|
|
607
|
+
AnsweredModelId: z.ZodNullable<z.ZodString>;
|
|
608
|
+
AnsweredModelName: z.ZodNullable<z.ZodString>;
|
|
609
|
+
AnsweredVendorId: z.ZodNullable<z.ZodString>;
|
|
610
|
+
AnsweredVendorName: z.ZodNullable<z.ZodString>;
|
|
611
|
+
DriverClass: z.ZodNullable<z.ZodString>;
|
|
612
|
+
/** The vendor's resolved version, when the driver reports one. For `LLMDecision`, the chat model that answered. */
|
|
613
|
+
ResolvedModel: z.ZodNullable<z.ZodString>;
|
|
614
|
+
/** Null when nothing was pinned. */
|
|
615
|
+
AnsweredByPinned: z.ZodNullable<z.ZodBoolean>;
|
|
616
|
+
/** True when a pinned run was answered by another model or vendor. */
|
|
617
|
+
FailedOver: z.ZodBoolean;
|
|
618
|
+
}, "strip", z.ZodTypeAny, {
|
|
619
|
+
PinnedModelId: string | null;
|
|
620
|
+
PinnedVendorId: string | null;
|
|
621
|
+
FailoverAllowed: boolean;
|
|
622
|
+
AnsweredModelId: string | null;
|
|
623
|
+
AnsweredModelName: string | null;
|
|
624
|
+
AnsweredVendorId: string | null;
|
|
625
|
+
AnsweredVendorName: string | null;
|
|
626
|
+
DriverClass: string | null;
|
|
627
|
+
ResolvedModel: string | null;
|
|
628
|
+
AnsweredByPinned: boolean | null;
|
|
629
|
+
FailedOver: boolean;
|
|
630
|
+
}, {
|
|
631
|
+
PinnedModelId: string | null;
|
|
632
|
+
PinnedVendorId: string | null;
|
|
633
|
+
FailoverAllowed: boolean;
|
|
634
|
+
AnsweredModelId: string | null;
|
|
635
|
+
AnsweredModelName: string | null;
|
|
636
|
+
AnsweredVendorId: string | null;
|
|
637
|
+
AnsweredVendorName: string | null;
|
|
638
|
+
DriverClass: string | null;
|
|
639
|
+
ResolvedModel: string | null;
|
|
640
|
+
AnsweredByPinned: boolean | null;
|
|
641
|
+
FailedOver: boolean;
|
|
642
|
+
}>;
|
|
643
|
+
/** The model record of one run. */
|
|
644
|
+
export type DecisionEvalModelRecord = z.infer<typeof DecisionEvalModelRecordSchema>;
|
|
645
|
+
/** The sampling a cell asked for, and whether the decision path applied it. */
|
|
646
|
+
export declare const DecisionEvalSamplingSchema: z.ZodObject<{
|
|
647
|
+
RequestedTemperature: z.ZodNullable<z.ZodNumber>;
|
|
648
|
+
RequestedSeed: z.ZodNullable<z.ZodNumber>;
|
|
649
|
+
Applied: z.ZodBoolean;
|
|
650
|
+
Note: z.ZodNullable<z.ZodString>;
|
|
651
|
+
}, "strip", z.ZodTypeAny, {
|
|
652
|
+
RequestedTemperature: number | null;
|
|
653
|
+
RequestedSeed: number | null;
|
|
654
|
+
Applied: boolean;
|
|
655
|
+
Note: string | null;
|
|
656
|
+
}, {
|
|
657
|
+
RequestedTemperature: number | null;
|
|
658
|
+
RequestedSeed: number | null;
|
|
659
|
+
Applied: boolean;
|
|
660
|
+
Note: string | null;
|
|
661
|
+
}>;
|
|
662
|
+
/** The sampling record of one run. */
|
|
663
|
+
export type DecisionEvalSampling = z.infer<typeof DecisionEvalSamplingSchema>;
|
|
664
|
+
/** The routing thresholds and calibration a run's verdict was reached under. */
|
|
665
|
+
export declare const DecisionEvalRoutingPolicySchema: z.ZodObject<{
|
|
666
|
+
/** `DECISION_ROUTING_MIN_CONFIDENCE`. */
|
|
667
|
+
MinConfidence: z.ZodNumber;
|
|
668
|
+
/** `DECISION_ROUTING_TIMEOUT_MS`: past it, production keeps continuity. */
|
|
669
|
+
TimeoutMs: z.ZodNumber;
|
|
670
|
+
/**
|
|
671
|
+
* The thread Likelihood's Platt calibration for the model that answered, or null when that
|
|
672
|
+
* exact model has none, and routing keeps continuity.
|
|
673
|
+
*/
|
|
674
|
+
Calibration: z.ZodNullable<z.ZodObject<{
|
|
675
|
+
A: z.ZodNumber;
|
|
676
|
+
B: z.ZodNumber;
|
|
677
|
+
}, "strip", z.ZodTypeAny, {
|
|
678
|
+
A: number;
|
|
679
|
+
B: number;
|
|
680
|
+
}, {
|
|
681
|
+
A: number;
|
|
682
|
+
B: number;
|
|
683
|
+
}>>;
|
|
684
|
+
}, "strip", z.ZodTypeAny, {
|
|
685
|
+
MinConfidence: number;
|
|
686
|
+
TimeoutMs: number;
|
|
687
|
+
Calibration: {
|
|
688
|
+
A: number;
|
|
689
|
+
B: number;
|
|
690
|
+
} | null;
|
|
691
|
+
}, {
|
|
692
|
+
MinConfidence: number;
|
|
693
|
+
TimeoutMs: number;
|
|
694
|
+
Calibration: {
|
|
695
|
+
A: number;
|
|
696
|
+
B: number;
|
|
697
|
+
} | null;
|
|
698
|
+
}>;
|
|
699
|
+
/** The routing policy of one run. */
|
|
700
|
+
export type DecisionEvalRoutingPolicy = z.infer<typeof DecisionEvalRoutingPolicySchema>;
|
|
701
|
+
/** What a Decision Eval run records as its `ActualOutput`. */
|
|
702
|
+
export declare const DecisionEvalActualOutputSchema: z.ZodObject<{
|
|
703
|
+
Decision: z.ZodEnum<["conversation-routing", "agent-discovery"]>;
|
|
704
|
+
StateLayout: z.ZodEnum<["production", "structured"]>;
|
|
705
|
+
PromptName: z.ZodString;
|
|
706
|
+
/** Every answer, summarized. A Choice keeps its full distribution. */
|
|
707
|
+
Answers: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
708
|
+
Kind: z.ZodEnum<["Likelihood", "Choice", "Score"]>;
|
|
709
|
+
Probability: z.ZodOptional<z.ZodNumber>;
|
|
710
|
+
Value: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
|
|
711
|
+
Confidence: z.ZodOptional<z.ZodNumber>;
|
|
712
|
+
Probabilities: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
713
|
+
}, "strip", z.ZodTypeAny, {
|
|
714
|
+
Kind: "Likelihood" | "Choice" | "Score";
|
|
715
|
+
Probability?: number | undefined;
|
|
716
|
+
Value?: string | number | undefined;
|
|
717
|
+
Confidence?: number | undefined;
|
|
718
|
+
Probabilities?: Record<string, number> | undefined;
|
|
719
|
+
}, {
|
|
720
|
+
Kind: "Likelihood" | "Choice" | "Score";
|
|
721
|
+
Probability?: number | undefined;
|
|
722
|
+
Value?: string | number | undefined;
|
|
723
|
+
Confidence?: number | undefined;
|
|
724
|
+
Probabilities?: Record<string, number> | undefined;
|
|
725
|
+
}>>;
|
|
726
|
+
/** The `continues` Likelihood's raw probability, or null when there is none. */
|
|
727
|
+
ContinuesProbability: z.ZodNullable<z.ZodNumber>;
|
|
728
|
+
/** The agent Choice's value and confidence, or null. */
|
|
729
|
+
Route: z.ZodNullable<z.ZodObject<{
|
|
730
|
+
Value: z.ZodString;
|
|
731
|
+
Confidence: z.ZodNumber;
|
|
732
|
+
}, "strip", z.ZodTypeAny, {
|
|
733
|
+
Value: string;
|
|
734
|
+
Confidence: number;
|
|
735
|
+
}, {
|
|
736
|
+
Value: string;
|
|
737
|
+
Confidence: number;
|
|
738
|
+
}>>;
|
|
739
|
+
/** What production would do with these answers (`InterpretRoutingAnswers`), or null without answers. */
|
|
740
|
+
RoutingVerdict: z.ZodNullable<z.ZodEnum<["Routed", "SomeoneElse", "KeptContinuity"]>>;
|
|
741
|
+
/**
|
|
742
|
+
* The routing policy that verdict was reached under, or null without answers. Absent from runs
|
|
743
|
+
* recorded before routing was calibrated: their verdicts used raw thresholds, so the scorecard
|
|
744
|
+
* does not score them as production's.
|
|
745
|
+
*/
|
|
746
|
+
RoutingPolicy: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
747
|
+
/** `DECISION_ROUTING_MIN_CONFIDENCE`. */
|
|
748
|
+
MinConfidence: z.ZodNumber;
|
|
749
|
+
/** `DECISION_ROUTING_TIMEOUT_MS`: past it, production keeps continuity. */
|
|
750
|
+
TimeoutMs: z.ZodNumber;
|
|
751
|
+
/**
|
|
752
|
+
* The thread Likelihood's Platt calibration for the model that answered, or null when that
|
|
753
|
+
* exact model has none, and routing keeps continuity.
|
|
754
|
+
*/
|
|
755
|
+
Calibration: z.ZodNullable<z.ZodObject<{
|
|
756
|
+
A: z.ZodNumber;
|
|
757
|
+
B: z.ZodNumber;
|
|
758
|
+
}, "strip", z.ZodTypeAny, {
|
|
759
|
+
A: number;
|
|
760
|
+
B: number;
|
|
761
|
+
}, {
|
|
762
|
+
A: number;
|
|
763
|
+
B: number;
|
|
764
|
+
}>>;
|
|
765
|
+
}, "strip", z.ZodTypeAny, {
|
|
766
|
+
MinConfidence: number;
|
|
767
|
+
TimeoutMs: number;
|
|
768
|
+
Calibration: {
|
|
769
|
+
A: number;
|
|
770
|
+
B: number;
|
|
771
|
+
} | null;
|
|
772
|
+
}, {
|
|
773
|
+
MinConfidence: number;
|
|
774
|
+
TimeoutMs: number;
|
|
775
|
+
Calibration: {
|
|
776
|
+
A: number;
|
|
777
|
+
B: number;
|
|
778
|
+
} | null;
|
|
779
|
+
}>>>;
|
|
780
|
+
Model: z.ZodObject<{
|
|
781
|
+
PinnedModelId: z.ZodNullable<z.ZodString>;
|
|
782
|
+
PinnedVendorId: z.ZodNullable<z.ZodString>;
|
|
783
|
+
FailoverAllowed: z.ZodBoolean;
|
|
784
|
+
AnsweredModelId: z.ZodNullable<z.ZodString>;
|
|
785
|
+
AnsweredModelName: z.ZodNullable<z.ZodString>;
|
|
786
|
+
AnsweredVendorId: z.ZodNullable<z.ZodString>;
|
|
787
|
+
AnsweredVendorName: z.ZodNullable<z.ZodString>;
|
|
788
|
+
DriverClass: z.ZodNullable<z.ZodString>;
|
|
789
|
+
/** The vendor's resolved version, when the driver reports one. For `LLMDecision`, the chat model that answered. */
|
|
790
|
+
ResolvedModel: z.ZodNullable<z.ZodString>;
|
|
791
|
+
/** Null when nothing was pinned. */
|
|
792
|
+
AnsweredByPinned: z.ZodNullable<z.ZodBoolean>;
|
|
793
|
+
/** True when a pinned run was answered by another model or vendor. */
|
|
794
|
+
FailedOver: z.ZodBoolean;
|
|
795
|
+
}, "strip", z.ZodTypeAny, {
|
|
796
|
+
PinnedModelId: string | null;
|
|
797
|
+
PinnedVendorId: string | null;
|
|
798
|
+
FailoverAllowed: boolean;
|
|
799
|
+
AnsweredModelId: string | null;
|
|
800
|
+
AnsweredModelName: string | null;
|
|
801
|
+
AnsweredVendorId: string | null;
|
|
802
|
+
AnsweredVendorName: string | null;
|
|
803
|
+
DriverClass: string | null;
|
|
804
|
+
ResolvedModel: string | null;
|
|
805
|
+
AnsweredByPinned: boolean | null;
|
|
806
|
+
FailedOver: boolean;
|
|
807
|
+
}, {
|
|
808
|
+
PinnedModelId: string | null;
|
|
809
|
+
PinnedVendorId: string | null;
|
|
810
|
+
FailoverAllowed: boolean;
|
|
811
|
+
AnsweredModelId: string | null;
|
|
812
|
+
AnsweredModelName: string | null;
|
|
813
|
+
AnsweredVendorId: string | null;
|
|
814
|
+
AnsweredVendorName: string | null;
|
|
815
|
+
DriverClass: string | null;
|
|
816
|
+
ResolvedModel: string | null;
|
|
817
|
+
AnsweredByPinned: boolean | null;
|
|
818
|
+
FailedOver: boolean;
|
|
819
|
+
}>;
|
|
820
|
+
Sampling: z.ZodObject<{
|
|
821
|
+
RequestedTemperature: z.ZodNullable<z.ZodNumber>;
|
|
822
|
+
RequestedSeed: z.ZodNullable<z.ZodNumber>;
|
|
823
|
+
Applied: z.ZodBoolean;
|
|
824
|
+
Note: z.ZodNullable<z.ZodString>;
|
|
825
|
+
}, "strip", z.ZodTypeAny, {
|
|
826
|
+
RequestedTemperature: number | null;
|
|
827
|
+
RequestedSeed: number | null;
|
|
828
|
+
Applied: boolean;
|
|
829
|
+
Note: string | null;
|
|
830
|
+
}, {
|
|
831
|
+
RequestedTemperature: number | null;
|
|
832
|
+
RequestedSeed: number | null;
|
|
833
|
+
Applied: boolean;
|
|
834
|
+
Note: string | null;
|
|
835
|
+
}>;
|
|
836
|
+
/** Wall-clock time of the one `ExecuteDecision` call, in milliseconds. */
|
|
837
|
+
LatencyMs: z.ZodNullable<z.ZodNumber>;
|
|
838
|
+
/** The `MJ: AI Prompt Runs` row the runner wrote. */
|
|
839
|
+
PromptRunId: z.ZodNullable<z.ZodString>;
|
|
840
|
+
/** The run's cost in USD, from the prompt run when it has one. */
|
|
841
|
+
CostUSD: z.ZodNullable<z.ZodNumber>;
|
|
842
|
+
/** Why the run produced no answers, or null. */
|
|
843
|
+
Error: z.ZodNullable<z.ZodString>;
|
|
844
|
+
}, "strip", z.ZodTypeAny, {
|
|
845
|
+
Error: string | null;
|
|
846
|
+
Decision: "conversation-routing" | "agent-discovery";
|
|
847
|
+
StateLayout: "production" | "structured";
|
|
848
|
+
PromptName: string;
|
|
849
|
+
Answers: Record<string, {
|
|
850
|
+
Kind: "Likelihood" | "Choice" | "Score";
|
|
851
|
+
Probability?: number | undefined;
|
|
852
|
+
Value?: string | number | undefined;
|
|
853
|
+
Confidence?: number | undefined;
|
|
854
|
+
Probabilities?: Record<string, number> | undefined;
|
|
855
|
+
}>;
|
|
856
|
+
ContinuesProbability: number | null;
|
|
857
|
+
Route: {
|
|
858
|
+
Value: string;
|
|
859
|
+
Confidence: number;
|
|
860
|
+
} | null;
|
|
861
|
+
RoutingVerdict: "Routed" | "SomeoneElse" | "KeptContinuity" | null;
|
|
862
|
+
Model: {
|
|
863
|
+
PinnedModelId: string | null;
|
|
864
|
+
PinnedVendorId: string | null;
|
|
865
|
+
FailoverAllowed: boolean;
|
|
866
|
+
AnsweredModelId: string | null;
|
|
867
|
+
AnsweredModelName: string | null;
|
|
868
|
+
AnsweredVendorId: string | null;
|
|
869
|
+
AnsweredVendorName: string | null;
|
|
870
|
+
DriverClass: string | null;
|
|
871
|
+
ResolvedModel: string | null;
|
|
872
|
+
AnsweredByPinned: boolean | null;
|
|
873
|
+
FailedOver: boolean;
|
|
874
|
+
};
|
|
875
|
+
Sampling: {
|
|
876
|
+
RequestedTemperature: number | null;
|
|
877
|
+
RequestedSeed: number | null;
|
|
878
|
+
Applied: boolean;
|
|
879
|
+
Note: string | null;
|
|
880
|
+
};
|
|
881
|
+
LatencyMs: number | null;
|
|
882
|
+
PromptRunId: string | null;
|
|
883
|
+
CostUSD: number | null;
|
|
884
|
+
RoutingPolicy?: {
|
|
885
|
+
MinConfidence: number;
|
|
886
|
+
TimeoutMs: number;
|
|
887
|
+
Calibration: {
|
|
888
|
+
A: number;
|
|
889
|
+
B: number;
|
|
890
|
+
} | null;
|
|
891
|
+
} | null | undefined;
|
|
892
|
+
}, {
|
|
893
|
+
Error: string | null;
|
|
894
|
+
Decision: "conversation-routing" | "agent-discovery";
|
|
895
|
+
StateLayout: "production" | "structured";
|
|
896
|
+
PromptName: string;
|
|
897
|
+
Answers: Record<string, {
|
|
898
|
+
Kind: "Likelihood" | "Choice" | "Score";
|
|
899
|
+
Probability?: number | undefined;
|
|
900
|
+
Value?: string | number | undefined;
|
|
901
|
+
Confidence?: number | undefined;
|
|
902
|
+
Probabilities?: Record<string, number> | undefined;
|
|
903
|
+
}>;
|
|
904
|
+
ContinuesProbability: number | null;
|
|
905
|
+
Route: {
|
|
906
|
+
Value: string;
|
|
907
|
+
Confidence: number;
|
|
908
|
+
} | null;
|
|
909
|
+
RoutingVerdict: "Routed" | "SomeoneElse" | "KeptContinuity" | null;
|
|
910
|
+
Model: {
|
|
911
|
+
PinnedModelId: string | null;
|
|
912
|
+
PinnedVendorId: string | null;
|
|
913
|
+
FailoverAllowed: boolean;
|
|
914
|
+
AnsweredModelId: string | null;
|
|
915
|
+
AnsweredModelName: string | null;
|
|
916
|
+
AnsweredVendorId: string | null;
|
|
917
|
+
AnsweredVendorName: string | null;
|
|
918
|
+
DriverClass: string | null;
|
|
919
|
+
ResolvedModel: string | null;
|
|
920
|
+
AnsweredByPinned: boolean | null;
|
|
921
|
+
FailedOver: boolean;
|
|
922
|
+
};
|
|
923
|
+
Sampling: {
|
|
924
|
+
RequestedTemperature: number | null;
|
|
925
|
+
RequestedSeed: number | null;
|
|
926
|
+
Applied: boolean;
|
|
927
|
+
Note: string | null;
|
|
928
|
+
};
|
|
929
|
+
LatencyMs: number | null;
|
|
930
|
+
PromptRunId: string | null;
|
|
931
|
+
CostUSD: number | null;
|
|
932
|
+
RoutingPolicy?: {
|
|
933
|
+
MinConfidence: number;
|
|
934
|
+
TimeoutMs: number;
|
|
935
|
+
Calibration: {
|
|
936
|
+
A: number;
|
|
937
|
+
B: number;
|
|
938
|
+
} | null;
|
|
939
|
+
} | null | undefined;
|
|
940
|
+
}>;
|
|
941
|
+
/** What a Decision Eval run records as its `ActualOutput`. */
|
|
942
|
+
export type DecisionEvalActualOutput = z.infer<typeof DecisionEvalActualOutputSchema>;
|
|
943
|
+
/** The `decision-label-match` oracle's configuration, with its defaults. */
|
|
944
|
+
export declare const DecisionLabelMatchConfigSchema: z.ZodObject<{
|
|
945
|
+
/** The Likelihood whose probability is compared with the label. */
|
|
946
|
+
question: z.ZodDefault<z.ZodString>;
|
|
947
|
+
/** The label that counts as the positive class. */
|
|
948
|
+
positiveLabel: z.ZodDefault<z.ZodEnum<["continue", "switch"]>>;
|
|
949
|
+
/** A probability at or above it predicts the positive class. */
|
|
950
|
+
threshold: z.ZodDefault<z.ZodNumber>;
|
|
951
|
+
}, "strip", z.ZodTypeAny, {
|
|
952
|
+
question: string;
|
|
953
|
+
positiveLabel: "continue" | "switch";
|
|
954
|
+
threshold: number;
|
|
955
|
+
}, {
|
|
956
|
+
question?: string | undefined;
|
|
957
|
+
positiveLabel?: "continue" | "switch" | undefined;
|
|
958
|
+
threshold?: number | undefined;
|
|
959
|
+
}>;
|
|
960
|
+
/** The `decision-label-match` oracle's configuration. */
|
|
961
|
+
export type DecisionLabelMatchConfig = z.infer<typeof DecisionLabelMatchConfigSchema>;
|
|
962
|
+
/**
|
|
963
|
+
* The `decision-label-match` oracle's `details`. On an `ambiguous` label, which is advisory and
|
|
964
|
+
* not scored, `positive`, `correct` and `brier` are null.
|
|
965
|
+
*/
|
|
966
|
+
export declare const DecisionLabelMatchDetailsSchema: z.ZodObject<{
|
|
967
|
+
probability: z.ZodNullable<z.ZodNumber>;
|
|
968
|
+
label: z.ZodEnum<["continue", "switch", "ambiguous"]>;
|
|
969
|
+
positive: z.ZodNullable<z.ZodUnion<[z.ZodLiteral<0>, z.ZodLiteral<1>]>>;
|
|
970
|
+
correct: z.ZodNullable<z.ZodBoolean>;
|
|
971
|
+
brier: z.ZodNullable<z.ZodNumber>;
|
|
972
|
+
}, "strip", z.ZodTypeAny, {
|
|
973
|
+
label: "continue" | "switch" | "ambiguous";
|
|
974
|
+
probability: number | null;
|
|
975
|
+
positive: 0 | 1 | null;
|
|
976
|
+
correct: boolean | null;
|
|
977
|
+
brier: number | null;
|
|
978
|
+
}, {
|
|
979
|
+
label: "continue" | "switch" | "ambiguous";
|
|
980
|
+
probability: number | null;
|
|
981
|
+
positive: 0 | 1 | null;
|
|
982
|
+
correct: boolean | null;
|
|
983
|
+
brier: number | null;
|
|
984
|
+
}>;
|
|
985
|
+
/** The `decision-label-match` oracle's `details`. */
|
|
986
|
+
export type DecisionLabelMatchDetails = z.infer<typeof DecisionLabelMatchDetailsSchema>;
|
|
987
|
+
/**
|
|
988
|
+
* Describes the first problem Zod found, as `path: message`.
|
|
989
|
+
*
|
|
990
|
+
* @param error The Zod error.
|
|
991
|
+
*/
|
|
992
|
+
export declare function DescribeZodError(error: z.ZodError): string;
|
|
993
|
+
//# sourceMappingURL=types.d.ts.map
|