@anvia/core 1.0.0-rc.2 → 1.0.0-rc.3
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 +69 -9
- package/dist/agent/index.d.ts +20 -13
- package/dist/agent/index.js +36 -15
- package/dist/{agent-yBG8e9Jj.d.ts → agent-CXScUOpX.d.ts} +12 -15
- package/dist/{chunk-77AIYARB.js → chunk-3CMWKK32.js} +28 -19
- package/dist/chunk-3CMWKK32.js.map +1 -0
- package/dist/chunk-3RM57ZT2.js +31 -0
- package/dist/chunk-3RM57ZT2.js.map +1 -0
- package/dist/{chunk-EINTGEGY.js → chunk-5MK3BISB.js} +101 -26
- package/dist/chunk-5MK3BISB.js.map +1 -0
- package/dist/{chunk-KIDGIJM7.js → chunk-AZB6N7P4.js} +94 -86
- package/dist/chunk-AZB6N7P4.js.map +1 -0
- package/dist/{chunk-DBSCKTUL.js → chunk-BY4OMNIU.js} +1746 -840
- package/dist/chunk-BY4OMNIU.js.map +1 -0
- package/dist/{chunk-KR3RCCHJ.js → chunk-D2ECOWN5.js} +26 -11
- package/dist/chunk-D2ECOWN5.js.map +1 -0
- package/dist/{chunk-FMHLROPQ.js → chunk-GQL5KRAH.js} +13 -33
- package/dist/chunk-GQL5KRAH.js.map +1 -0
- package/dist/{chunk-OJH6HWHX.js → chunk-KFR4CDGK.js} +8 -2
- package/dist/chunk-KFR4CDGK.js.map +1 -0
- package/dist/{chunk-D37WMSP6.js → chunk-KV6QCRQ4.js} +50 -10
- package/dist/chunk-KV6QCRQ4.js.map +1 -0
- package/dist/{chunk-XKYYBABH.js → chunk-LXMAFD23.js} +2 -2
- package/dist/{chunk-TIZYTPJO.js → chunk-PK5LKOFL.js} +33 -2
- package/dist/chunk-PK5LKOFL.js.map +1 -0
- package/dist/chunk-TRQ3XRFD.js +54 -0
- package/dist/chunk-TRQ3XRFD.js.map +1 -0
- package/dist/{chunk-CWM7B2OO.js → chunk-VKYZZXP5.js} +10 -2
- package/dist/chunk-VKYZZXP5.js.map +1 -0
- package/dist/{chunk-4WI3VGZK.js → chunk-ZCPOIDAQ.js} +3 -3
- package/dist/{client-B8DT1vUG.d.ts → client-DvUatElp.d.ts} +4 -3
- package/dist/completion/index.d.ts +3 -3
- package/dist/completion/index.js +2 -2
- package/dist/documents/index.d.ts +34 -0
- package/dist/documents/index.js +315 -0
- package/dist/documents/index.js.map +1 -0
- package/dist/{dynamic-tools-KwEGRbHp.d.ts → dynamic-tools-AEBOTgu1.d.ts} +3 -3
- package/dist/embeddings/index.js +2 -1
- package/dist/evals/index.d.ts +19 -11
- package/dist/evals/index.js +88 -55
- package/dist/evals/index.js.map +1 -1
- package/dist/extractor/index.d.ts +1 -1
- package/dist/extractor/index.js +3 -3
- package/dist/guardrails/index.d.ts +6 -129
- package/dist/guardrails/index.js +1 -1
- package/dist/image-generation/index.d.ts +1 -1
- package/dist/index.d.ts +15 -14
- package/dist/index.js +40 -19
- package/dist/interactions-csssHYcN.d.ts +174 -0
- package/dist/internal/agent.d.ts +18 -22
- package/dist/internal/agent.js +45 -14
- package/dist/internal/agent.js.map +1 -1
- package/dist/mcp/index.d.ts +4 -4
- package/dist/mcp/index.js +6 -5
- package/dist/memory/index.d.ts +3 -3
- package/dist/memory/index.js +3 -3
- package/dist/{message-schema-Cn7ezRfJ.d.ts → message-schema-B2M7AYzR.d.ts} +1 -1
- package/dist/observability/index.d.ts +8 -7
- package/dist/observability/index.js +3 -3
- package/dist/pipeline/index.d.ts +18 -18
- package/dist/pipeline/index.js +20 -29
- package/dist/pipeline/index.js.map +1 -1
- package/dist/skills/index.d.ts +4 -4
- package/dist/skills/index.js +6 -5
- package/dist/speech-generation/index.d.ts +1 -1
- package/dist/text-C_6eKrbC.d.ts +32 -0
- package/dist/{think-tool-6H2QNQzQ.d.ts → think-tool-D8frXxwV.d.ts} +16 -2
- package/dist/tool/index.d.ts +6 -6
- package/dist/tool/index.js +9 -4
- package/dist/{tool--Mz4v1eL.d.ts → tool-r62gf3QY.d.ts} +3 -2
- package/dist/transcription/index.d.ts +1 -1
- package/dist/{types-Dld1TpWj.d.ts → types-C3gv9EX6.d.ts} +1 -1
- package/dist/{types-3x3mOLHU.d.ts → types-CElwurHZ.d.ts} +56 -35
- package/dist/types-CIPaIbZo.d.ts +105 -0
- package/dist/{types-CQ_ioXWK.d.ts → types-D9rKQ_as.d.ts} +24 -2
- package/dist/{types-BVzM4RsC.d.ts → types-DbolvLtZ.d.ts} +1 -1
- package/dist/{types-DiJqJejp.d.ts → types-RT3cuyRk.d.ts} +1 -1
- package/dist/vector-store/index.d.ts +4 -4
- package/dist/vector-store/index.js +4 -3
- package/package.json +6 -6
- package/dist/chunk-77AIYARB.js.map +0 -1
- package/dist/chunk-CWM7B2OO.js.map +0 -1
- package/dist/chunk-D37WMSP6.js.map +0 -1
- package/dist/chunk-DBSCKTUL.js.map +0 -1
- package/dist/chunk-EINTGEGY.js.map +0 -1
- package/dist/chunk-FMHLROPQ.js.map +0 -1
- package/dist/chunk-KIDGIJM7.js.map +0 -1
- package/dist/chunk-KR3RCCHJ.js.map +0 -1
- package/dist/chunk-OJH6HWHX.js.map +0 -1
- package/dist/chunk-TIZYTPJO.js.map +0 -1
- package/dist/loaders/index.d.ts +0 -87
- package/dist/loaders/index.js +0 -299
- package/dist/loaders/index.js.map +0 -1
- package/dist/middleware-C7PdmKF7.d.ts +0 -56
- /package/dist/{chunk-XKYYBABH.js.map → chunk-LXMAFD23.js.map} +0 -0
- /package/dist/{chunk-4WI3VGZK.js.map → chunk-ZCPOIDAQ.js.map} +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { b as RetrySetting } from './retry-CjvSlKGW.js';
|
|
2
|
-
import { v as ToolDefinition } from './types-
|
|
2
|
+
import { v as ToolDefinition } from './types-D9rKQ_as.js';
|
|
3
3
|
import { V as VectorMetadata, E as EmbeddingModel, a as EmbeddedDocument } from './types-Cr4uiYo5.js';
|
|
4
|
-
import { A as AnyTool } from './tool
|
|
5
|
-
import { V as VectorFilter, a as VectorSearchResult, b as VectorInspectRequest, c as VectorInspectPage } from './types-
|
|
4
|
+
import { A as AnyTool } from './tool-r62gf3QY.js';
|
|
5
|
+
import { V as VectorFilter, a as VectorSearchResult, b as VectorInspectRequest, c as VectorInspectPage } from './types-C3gv9EX6.js';
|
|
6
6
|
|
|
7
7
|
type ToolSearchDocument<Metadata extends VectorMetadata = VectorMetadata> = {
|
|
8
8
|
toolName: string;
|
package/dist/embeddings/index.js
CHANGED
package/dist/evals/index.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { U as Usage, J as JsonObject, C as CompletionModel, M as Message } from '../types-
|
|
1
|
+
import { U as Usage, J as JsonObject, C as CompletionModel, M as Message } from '../types-D9rKQ_as.js';
|
|
2
2
|
import { Z as ZodSchema } from '../zod-schema-C7F4clpm.js';
|
|
3
|
-
import {
|
|
3
|
+
import { a as AgentInteractionRequest, b as AgentInteractionResponse } from '../interactions-csssHYcN.js';
|
|
4
|
+
import { t as AgentSuspendedResult, j as AgentResponse, l as AgentRunOptions, k as AgentResult } from '../types-CElwurHZ.js';
|
|
4
5
|
import { E as EmbeddingModel } from '../types-Cr4uiYo5.js';
|
|
5
6
|
import '../model-call-options-CZkSw_xN.js';
|
|
6
7
|
import 'zod';
|
|
7
|
-
import '../retry-CjvSlKGW.js';
|
|
8
|
-
import '../guardrails/index.js';
|
|
9
8
|
import '../type-utils-CtHVDRn_.js';
|
|
10
|
-
import '../
|
|
11
|
-
import '../
|
|
12
|
-
import '../
|
|
9
|
+
import '../retry-CjvSlKGW.js';
|
|
10
|
+
import '../types-CIPaIbZo.js';
|
|
11
|
+
import '../types-DbolvLtZ.js';
|
|
12
|
+
import '../tool-r62gf3QY.js';
|
|
13
13
|
|
|
14
14
|
type EvalOutcome<Score = unknown> = {
|
|
15
15
|
outcome: "pass";
|
|
@@ -394,6 +394,14 @@ type AgentEvalTargetOptions<Input, AgentOutput = string, Output = AgentResponse<
|
|
|
394
394
|
input: Input;
|
|
395
395
|
testCase: EvalCase<Input, Expected>;
|
|
396
396
|
}): AgentRunOptions<AgentOutput> | Promise<AgentRunOptions<AgentOutput>>;
|
|
397
|
+
interactions?: {
|
|
398
|
+
maxResponses?: number | undefined;
|
|
399
|
+
respond(args: {
|
|
400
|
+
interaction: AgentInteractionRequest;
|
|
401
|
+
testCase: EvalCase<Input, Expected>;
|
|
402
|
+
phase: number;
|
|
403
|
+
}): AgentInteractionResponse | Promise<AgentInteractionResponse>;
|
|
404
|
+
} | undefined;
|
|
397
405
|
} & (IsExactly<Output, AgentResponse<AgentOutput>> extends true ? {
|
|
398
406
|
output?(args: {
|
|
399
407
|
response: AgentResponse<AgentOutput>;
|
|
@@ -405,9 +413,9 @@ type AgentEvalTargetOptions<Input, AgentOutput = string, Output = AgentResponse<
|
|
|
405
413
|
testCase: EvalCase<Input, Expected>;
|
|
406
414
|
}): Output | Promise<Output>;
|
|
407
415
|
});
|
|
408
|
-
declare class
|
|
409
|
-
readonly result:
|
|
410
|
-
constructor(result:
|
|
416
|
+
declare class AgentEvalSuspensionError extends Error {
|
|
417
|
+
readonly result: AgentSuspendedResult;
|
|
418
|
+
constructor(result: AgentSuspendedResult, message?: string);
|
|
411
419
|
}
|
|
412
420
|
declare function agentEvalTarget<Input, AgentOutput = string, Output = AgentResponse<AgentOutput>, Expected = unknown>(options: AgentEvalTargetOptions<Input, AgentOutput, Output, Expected>): EvalTarget<Input, Output, Expected>;
|
|
413
421
|
|
|
@@ -660,4 +668,4 @@ declare function defineEvalSuite<const Cases extends readonly EvalCaseLike[], co
|
|
|
660
668
|
target: Target;
|
|
661
669
|
};
|
|
662
670
|
|
|
663
|
-
export { type AbstentionCategory, type AbstentionOptions,
|
|
671
|
+
export { type AbstentionCategory, type AbstentionOptions, AgentEvalSuspensionError, type AgentEvalTargetOptions, type AnswerRelevancyOptions, type AnyEvalMetric, type ContainsAllOptions, type ContainsAnyOptions, type ContainsListOptions, type ContainsOptions, type DefaultEvalActual, type DefinedEvalSuite, type DoesNotMatchOptions, EvalAssertionError, type EvalCase, type EvalCaseRequirements, type EvalCaseResult, type EvalCasesExpected, type EvalCasesForMetrics, type EvalCasesInput, type EvalCostCalculatorArgs, type EvalCostOptions, type EvalCostSummary, type EvalDataType, type EvalExpectations, type EvalExpectedOutcomes, type EvalExpectedTotals, type EvalMetadata, type EvalMetric, type EvalMetricArgs, type EvalMetricDescriptor, type EvalMetricResult, type EvalMetricResultFor, type EvalMetricScore, EvalOutcome, type EvalOutcomeStatus, type EvalOutputFormat, type EvalOutputWriters, type EvalReportArgs, type EvalReporter, EvalReporterDispatchError, type EvalReporterErrorPolicy, type EvalRunContext, type EvalRunEndArgs, type EvalRunOptions, type EvalRunStartArgs, type EvalScoreDirection, type EvalScoreMap, type EvalScoreProjection, type EvalSuiteResult, type EvalTarget, type EvalTargetUsageSelector, type EvalTotals, type EvalTraceCarrier, type EvalTraceRef, type EvalTraceSelector, type EvalTraceSelectorArgs, type EvalTurn, type EvalUsageSummary, type ExactMatchOptions, type FaithfulnessOptions, type GEvalOptions, type GEvalParameter, type GEvalRubric, type HallucinationOptions, type JsonCorrectnessOptions, type KnowledgeRetentionOptions, type LlmJudgeOptions, type LlmScoreMetricScore, type LlmScoreOptions, type MatchesOptions, type MaxLengthOptions, type NotContainsOptions, type PrintEvalResultOptions, type PromptAlignmentOptions, type RequiredFieldsOptions, type RunEvalCliOptions, type RunEvalSuiteOptions, type SelectorOrValue, type SemanticSimilarityOptions, type SummarizationOptions, type TurnRelevancyOptions, type ValueSelector, abstention, agentEvalTarget, answerRelevancy, assertEvalOutcomes, assertEvalTotals, contains, containsAll, containsAny, defaultEvalTraceSelector, defineEvalCases, defineEvalSuite, defineMetric, doesNotMatch, evalExitCode, exactMatch, faithfulness, gEval, hallucination, jsonCorrectness, knowledgeRetention, llmJudge, llmScore, matches, maxLength, notContains, printEvalResult, projectEvalOutcome, promptAlignment, requiredFields, resolveEvalTraceRef, runEvalCli, runEvalSuite, selectPromptOutput, semanticSimilarity, summarization, turnRelevancy };
|
package/dist/evals/index.js
CHANGED
|
@@ -1,28 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
|
-
AgentRunBlockedError
|
|
3
|
-
|
|
4
|
-
} from "../chunk-DBSCKTUL.js";
|
|
5
|
-
import "../chunk-YK4WAAS4.js";
|
|
6
|
-
import "../chunk-EINTGEGY.js";
|
|
7
|
-
import "../chunk-CQNNSZPG.js";
|
|
8
|
-
import "../chunk-D37WMSP6.js";
|
|
9
|
-
import "../chunk-77AIYARB.js";
|
|
10
|
-
import "../chunk-OJH6HWHX.js";
|
|
11
|
-
import "../chunk-CWM7B2OO.js";
|
|
2
|
+
AgentRunBlockedError
|
|
3
|
+
} from "../chunk-TRQ3XRFD.js";
|
|
12
4
|
import {
|
|
13
5
|
cosineSimilarity,
|
|
14
|
-
embedText
|
|
6
|
+
embedText
|
|
7
|
+
} from "../chunk-GQL5KRAH.js";
|
|
8
|
+
import {
|
|
15
9
|
mapWithConcurrency
|
|
16
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-3RM57ZT2.js";
|
|
17
11
|
import {
|
|
18
12
|
extract
|
|
19
|
-
} from "../chunk-
|
|
13
|
+
} from "../chunk-ZCPOIDAQ.js";
|
|
20
14
|
import "../chunk-MGNTXGTX.js";
|
|
21
15
|
import {
|
|
22
16
|
Usage
|
|
23
|
-
} from "../chunk-
|
|
24
|
-
import "../chunk-
|
|
25
|
-
import "../chunk-KIDGIJM7.js";
|
|
17
|
+
} from "../chunk-D2ECOWN5.js";
|
|
18
|
+
import "../chunk-PK5LKOFL.js";
|
|
26
19
|
import "../chunk-FN7HLLAZ.js";
|
|
27
20
|
|
|
28
21
|
// src/evals/advanced-metrics.ts
|
|
@@ -1122,26 +1115,61 @@ function contentText(content) {
|
|
|
1122
1115
|
}
|
|
1123
1116
|
|
|
1124
1117
|
// src/evals/agent-target.ts
|
|
1125
|
-
var
|
|
1126
|
-
constructor(result) {
|
|
1127
|
-
super(
|
|
1118
|
+
var AgentEvalSuspensionError = class extends Error {
|
|
1119
|
+
constructor(result, message = "Agent eval target suspended without an interaction responder.") {
|
|
1120
|
+
super(message);
|
|
1128
1121
|
this.result = result;
|
|
1129
|
-
this.name = "
|
|
1122
|
+
this.name = "AgentEvalSuspensionError";
|
|
1130
1123
|
}
|
|
1131
1124
|
result;
|
|
1132
1125
|
};
|
|
1133
1126
|
function agentEvalTarget(options) {
|
|
1134
1127
|
return async (input, testCase) => {
|
|
1128
|
+
const maxResponses = options.interactions?.maxResponses ?? 10;
|
|
1129
|
+
if (!Number.isSafeInteger(maxResponses) || maxResponses < 1) {
|
|
1130
|
+
throw new TypeError("Agent eval interactions.maxResponses must be a positive integer.");
|
|
1131
|
+
}
|
|
1135
1132
|
const request = await options.request({ input, testCase });
|
|
1136
|
-
const
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1133
|
+
const runSettings = agentRunSettings(request);
|
|
1134
|
+
let response = await options.agent.generate(request);
|
|
1135
|
+
let phase = 0;
|
|
1136
|
+
while (response.status === "suspended") {
|
|
1137
|
+
if (options.interactions === void 0) {
|
|
1138
|
+
throw new AgentEvalSuspensionError(response);
|
|
1139
|
+
}
|
|
1140
|
+
if (phase >= maxResponses) {
|
|
1141
|
+
throw new AgentEvalSuspensionError(
|
|
1142
|
+
response,
|
|
1143
|
+
`Agent eval target exceeded the interaction response limit of ${maxResponses}.`
|
|
1144
|
+
);
|
|
1145
|
+
}
|
|
1146
|
+
phase += 1;
|
|
1147
|
+
const interactionResponse = await options.interactions.respond({
|
|
1148
|
+
interaction: response.interaction,
|
|
1149
|
+
testCase,
|
|
1150
|
+
phase
|
|
1151
|
+
});
|
|
1152
|
+
response = await options.agent.generate({
|
|
1153
|
+
continuation: response.continuation,
|
|
1154
|
+
response: interactionResponse,
|
|
1155
|
+
...runSettings
|
|
1156
|
+
});
|
|
1140
1157
|
}
|
|
1141
1158
|
if (response.status === "blocked") throw new AgentRunBlockedError(response);
|
|
1142
1159
|
return options.output === void 0 ? response : await options.output({ response, testCase });
|
|
1143
1160
|
};
|
|
1144
1161
|
}
|
|
1162
|
+
function agentRunSettings(request) {
|
|
1163
|
+
const {
|
|
1164
|
+
prompt: _prompt,
|
|
1165
|
+
messages: _messages,
|
|
1166
|
+
session: _session,
|
|
1167
|
+
continuation: _continuation,
|
|
1168
|
+
response: _response,
|
|
1169
|
+
...settings
|
|
1170
|
+
} = request;
|
|
1171
|
+
return settings;
|
|
1172
|
+
}
|
|
1145
1173
|
|
|
1146
1174
|
// src/evals/reporting.ts
|
|
1147
1175
|
function projectEvalOutcome(outcome, dataType, projectScore) {
|
|
@@ -1286,25 +1314,26 @@ async function runEvalSuite(options) {
|
|
|
1286
1314
|
metrics: aggregates.metrics,
|
|
1287
1315
|
cases: aggregates.cases,
|
|
1288
1316
|
usage: aggregates.usage,
|
|
1289
|
-
...aggregates.cost === void 0 ? {} : { cost: aggregates.cost },
|
|
1290
1317
|
durationMs: Date.now() - startedAtMs,
|
|
1291
1318
|
reporterErrors
|
|
1292
1319
|
};
|
|
1320
|
+
if (aggregates.cost !== void 0) {
|
|
1321
|
+
result.cost = aggregates.cost;
|
|
1322
|
+
}
|
|
1323
|
+
const runEndArgs = {
|
|
1324
|
+
...lifecycle,
|
|
1325
|
+
status: "completed",
|
|
1326
|
+
completedAt,
|
|
1327
|
+
durationMs: result.durationMs,
|
|
1328
|
+
metrics: result.metrics,
|
|
1329
|
+
cases: result.cases,
|
|
1330
|
+
usage: result.usage
|
|
1331
|
+
};
|
|
1332
|
+
if (result.cost !== void 0) {
|
|
1333
|
+
runEndArgs.cost = result.cost;
|
|
1334
|
+
}
|
|
1293
1335
|
result.reporterErrors.push(
|
|
1294
|
-
...await notifyRunEnd(
|
|
1295
|
-
reporters,
|
|
1296
|
-
{
|
|
1297
|
-
...lifecycle,
|
|
1298
|
-
status: "completed",
|
|
1299
|
-
completedAt,
|
|
1300
|
-
durationMs: result.durationMs,
|
|
1301
|
-
metrics: result.metrics,
|
|
1302
|
-
cases: result.cases,
|
|
1303
|
-
usage: result.usage,
|
|
1304
|
-
...result.cost === void 0 ? {} : { cost: result.cost }
|
|
1305
|
-
},
|
|
1306
|
-
options.reporterErrorPolicy ?? "collect"
|
|
1307
|
-
)
|
|
1336
|
+
...await notifyRunEnd(reporters, runEndArgs, options.reporterErrorPolicy ?? "collect")
|
|
1308
1337
|
);
|
|
1309
1338
|
return result;
|
|
1310
1339
|
}
|
|
@@ -1444,13 +1473,14 @@ function resolveRun(options, startedAtMs) {
|
|
|
1444
1473
|
throw new TypeError(`Evaluation run ${label} must contain 1 to 256 characters`);
|
|
1445
1474
|
}
|
|
1446
1475
|
}
|
|
1447
|
-
|
|
1476
|
+
const run = {
|
|
1448
1477
|
id,
|
|
1449
|
-
startedAt: new Date(startedAtMs).toISOString()
|
|
1450
|
-
...options.run?.datasetName === void 0 ? {} : { datasetName: options.run.datasetName },
|
|
1451
|
-
...options.run?.datasetVersion === void 0 ? {} : { datasetVersion: options.run.datasetVersion },
|
|
1452
|
-
...options.run?.metadata === void 0 ? {} : { metadata: options.run.metadata }
|
|
1478
|
+
startedAt: new Date(startedAtMs).toISOString()
|
|
1453
1479
|
};
|
|
1480
|
+
if (options.run?.datasetName !== void 0) run.datasetName = options.run.datasetName;
|
|
1481
|
+
if (options.run?.datasetVersion !== void 0) run.datasetVersion = options.run.datasetVersion;
|
|
1482
|
+
if (options.run?.metadata !== void 0) run.metadata = options.run.metadata;
|
|
1483
|
+
return run;
|
|
1454
1484
|
}
|
|
1455
1485
|
async function notifyRunStart(reporters, args, errorPolicy) {
|
|
1456
1486
|
const errors = [];
|
|
@@ -1737,18 +1767,21 @@ function jsonResult(result) {
|
|
|
1737
1767
|
}
|
|
1738
1768
|
function expectationMismatches(result, expectations) {
|
|
1739
1769
|
if (expectations === void 0) return [];
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1770
|
+
const mismatches = [];
|
|
1771
|
+
if (expectations.totals !== void 0) {
|
|
1772
|
+
mismatches.push(...totalMismatches(result, expectations.totals));
|
|
1773
|
+
}
|
|
1774
|
+
if (expectations.outcomes !== void 0) {
|
|
1775
|
+
mismatches.push(...outcomeMismatches(result, expectations.outcomes));
|
|
1776
|
+
}
|
|
1777
|
+
return mismatches;
|
|
1744
1778
|
}
|
|
1745
1779
|
function totalMismatches(result, expected) {
|
|
1746
|
-
const directMetrics = {
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
};
|
|
1780
|
+
const directMetrics = {};
|
|
1781
|
+
if (expected.total !== void 0) directMetrics.total = expected.total;
|
|
1782
|
+
if (expected.passed !== void 0) directMetrics.passed = expected.passed;
|
|
1783
|
+
if (expected.failed !== void 0) directMetrics.failed = expected.failed;
|
|
1784
|
+
if (expected.invalid !== void 0) directMetrics.invalid = expected.invalid;
|
|
1752
1785
|
return [
|
|
1753
1786
|
...totalsGroupMismatches("metrics", result.metrics, {
|
|
1754
1787
|
...directMetrics,
|
|
@@ -2115,7 +2148,7 @@ function defineEvalSuite(options) {
|
|
|
2115
2148
|
};
|
|
2116
2149
|
}
|
|
2117
2150
|
export {
|
|
2118
|
-
|
|
2151
|
+
AgentEvalSuspensionError,
|
|
2119
2152
|
EvalAssertionError,
|
|
2120
2153
|
EvalOutcome,
|
|
2121
2154
|
EvalReporterDispatchError,
|