@agentica/benchmark 0.7.0-dev.20250224-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/LICENSE +21 -0
- package/lib/AgenticaCallBenchmark.d.ts +137 -0
- package/lib/AgenticaCallBenchmark.js +187 -0
- package/lib/AgenticaCallBenchmark.js.map +1 -0
- package/lib/AgenticaSelectBenchmark.d.ts +123 -0
- package/lib/AgenticaSelectBenchmark.js +185 -0
- package/lib/AgenticaSelectBenchmark.js.map +1 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +19 -0
- package/lib/index.js.map +1 -0
- package/lib/index.mjs +449 -0
- package/lib/index.mjs.map +1 -0
- package/lib/internal/AgenticaBenchmarkPredicator.d.ts +32 -0
- package/lib/internal/AgenticaBenchmarkPredicator.js +179 -0
- package/lib/internal/AgenticaBenchmarkPredicator.js.map +1 -0
- package/lib/internal/AgenticaBenchmarkUtil.d.ts +5 -0
- package/lib/internal/AgenticaBenchmarkUtil.js +37 -0
- package/lib/internal/AgenticaBenchmarkUtil.js.map +1 -0
- package/lib/internal/AgenticaCallBenchmarkReporter.d.ts +4 -0
- package/lib/internal/AgenticaCallBenchmarkReporter.js +136 -0
- package/lib/internal/AgenticaCallBenchmarkReporter.js.map +1 -0
- package/lib/internal/AgenticaPromptReporter.d.ts +4 -0
- package/lib/internal/AgenticaPromptReporter.js +49 -0
- package/lib/internal/AgenticaPromptReporter.js.map +1 -0
- package/lib/internal/AgenticaSelectBenchmarkReporter.d.ts +1 -0
- package/lib/internal/AgenticaSelectBenchmarkReporter.js +172 -0
- package/lib/internal/AgenticaSelectBenchmarkReporter.js.map +1 -0
- package/lib/structures/IAgenticaBenchmarkExpected.d.ts +44 -0
- package/lib/structures/IAgenticaBenchmarkExpected.js +3 -0
- package/lib/structures/IAgenticaBenchmarkExpected.js.map +1 -0
- package/lib/structures/IAgenticaCallBenchmarkEvent.d.ts +95 -0
- package/lib/structures/IAgenticaCallBenchmarkEvent.js +3 -0
- package/lib/structures/IAgenticaCallBenchmarkEvent.js.map +1 -0
- package/lib/structures/IAgenticaCallBenchmarkResult.d.ts +62 -0
- package/lib/structures/IAgenticaCallBenchmarkResult.js +3 -0
- package/lib/structures/IAgenticaCallBenchmarkResult.js.map +1 -0
- package/lib/structures/IAgenticaCallBenchmarkScenario.d.ts +36 -0
- package/lib/structures/IAgenticaCallBenchmarkScenario.js +3 -0
- package/lib/structures/IAgenticaCallBenchmarkScenario.js.map +1 -0
- package/lib/structures/IAgenticaSelectBenchmarkEvent.d.ts +92 -0
- package/lib/structures/IAgenticaSelectBenchmarkEvent.js +3 -0
- package/lib/structures/IAgenticaSelectBenchmarkEvent.js.map +1 -0
- package/lib/structures/IAgenticaSelectBenchmarkResult.d.ts +62 -0
- package/lib/structures/IAgenticaSelectBenchmarkResult.js +3 -0
- package/lib/structures/IAgenticaSelectBenchmarkResult.js.map +1 -0
- package/lib/structures/IAgenticaSelectBenchmarkScenario.d.ts +36 -0
- package/lib/structures/IAgenticaSelectBenchmarkScenario.js +3 -0
- package/lib/structures/IAgenticaSelectBenchmarkScenario.js.map +1 -0
- package/lib/utils/MathUtil.d.ts +3 -0
- package/lib/utils/MathUtil.js +8 -0
- package/lib/utils/MathUtil.js.map +1 -0
- package/lib/utils/TokenUsageComputer.d.ts +5 -0
- package/lib/utils/TokenUsageComputer.js +37 -0
- package/lib/utils/TokenUsageComputer.js.map +1 -0
- package/package.json +57 -0
- package/src/AgenticaCallBenchmark.ts +259 -0
- package/src/AgenticaSelectBenchmark.ts +262 -0
- package/src/index.ts +3 -0
- package/src/internal/AgenticaBenchmarkPredicator.ts +216 -0
- package/src/internal/AgenticaBenchmarkUtil.ts +40 -0
- package/src/internal/AgenticaCallBenchmarkReporter.ts +177 -0
- package/src/internal/AgenticaPromptReporter.ts +43 -0
- package/src/internal/AgenticaSelectBenchmarkReporter.ts +212 -0
- package/src/structures/IAgenticaBenchmarkExpected.ts +58 -0
- package/src/structures/IAgenticaCallBenchmarkEvent.ts +109 -0
- package/src/structures/IAgenticaCallBenchmarkResult.ts +69 -0
- package/src/structures/IAgenticaCallBenchmarkScenario.ts +39 -0
- package/src/structures/IAgenticaSelectBenchmarkEvent.ts +110 -0
- package/src/structures/IAgenticaSelectBenchmarkResult.ts +69 -0
- package/src/structures/IAgenticaSelectBenchmarkScenario.ts +39 -0
- package/src/utils/MathUtil.ts +3 -0
- package/src/utils/TokenUsageComputer.ts +40 -0
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.AgenticaBenchmarkPredicator = void 0;
|
|
16
|
+
const typia_1 = __importDefault(require("typia"));
|
|
17
|
+
var AgenticaBenchmarkPredicator;
|
|
18
|
+
(function (AgenticaBenchmarkPredicator) {
|
|
19
|
+
AgenticaBenchmarkPredicator.isNext = (agent) => __awaiter(this, void 0, void 0, function* () {
|
|
20
|
+
var _a, _b, _c;
|
|
21
|
+
const last = agent.getPromptHistories().at(-1);
|
|
22
|
+
if ((last === null || last === void 0 ? void 0 : last.type) !== "text" || last.role !== "assistant")
|
|
23
|
+
return null;
|
|
24
|
+
const consent = {
|
|
25
|
+
model: "chatgpt",
|
|
26
|
+
options: {
|
|
27
|
+
reference: false,
|
|
28
|
+
strict: false,
|
|
29
|
+
separate: null
|
|
30
|
+
},
|
|
31
|
+
functions: [
|
|
32
|
+
{
|
|
33
|
+
name: "consent",
|
|
34
|
+
parameters: {
|
|
35
|
+
description: "Properties for asking the user's consent",
|
|
36
|
+
type: "object",
|
|
37
|
+
properties: {
|
|
38
|
+
content: {
|
|
39
|
+
description: "Reason of the message implying what the AI agent wants\nto do at the next step after the user's consent.",
|
|
40
|
+
type: "string"
|
|
41
|
+
},
|
|
42
|
+
reply: {
|
|
43
|
+
title: "Recommended reply message for the user",
|
|
44
|
+
description: "Recommended reply message for the user.\n\nThe message what AI agent wants the user to reply\naccepting the AI agent's next job suggestion.",
|
|
45
|
+
type: "string"
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
required: [
|
|
49
|
+
"content",
|
|
50
|
+
"reply"
|
|
51
|
+
],
|
|
52
|
+
additionalProperties: false,
|
|
53
|
+
$defs: {}
|
|
54
|
+
},
|
|
55
|
+
description: "Ask user to consent for what the AI agent wants to do next.\n\nIf AI agent wants to do some function calling at next,\nbut it needs the user's consent about the function calling to do,\nthen call this tool function."
|
|
56
|
+
}
|
|
57
|
+
]
|
|
58
|
+
}.functions[0];
|
|
59
|
+
const result = yield agent["props"].provider.api.chat.completions.create({
|
|
60
|
+
model: agent["props"].provider.model,
|
|
61
|
+
messages: [
|
|
62
|
+
{
|
|
63
|
+
role: "system",
|
|
64
|
+
content: [
|
|
65
|
+
"You are an helpful assistant.",
|
|
66
|
+
"",
|
|
67
|
+
"If what the assistant said seems like to asking for",
|
|
68
|
+
"user's consent about some function calling at the next step,",
|
|
69
|
+
"use the tools appropriately to step to the next.",
|
|
70
|
+
].join("\n"),
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
role: "assistant",
|
|
74
|
+
content: last.text,
|
|
75
|
+
},
|
|
76
|
+
],
|
|
77
|
+
tools: [
|
|
78
|
+
{
|
|
79
|
+
type: "function",
|
|
80
|
+
function: {
|
|
81
|
+
name: consent.name,
|
|
82
|
+
description: consent.description,
|
|
83
|
+
parameters: consent.parameters,
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
],
|
|
87
|
+
tool_choice: "required",
|
|
88
|
+
parallel_tool_calls: false,
|
|
89
|
+
}, agent["props"].provider.options);
|
|
90
|
+
const toolCall = (_c = ((_b = (_a = result.choices[0]) === null || _a === void 0 ? void 0 : _a.message.tool_calls) !== null && _b !== void 0 ? _b : []).filter((tc) => tc.type === "function" && tc.function.name === consent.name)) === null || _c === void 0 ? void 0 : _c[0];
|
|
91
|
+
if (toolCall === undefined)
|
|
92
|
+
return null;
|
|
93
|
+
const input = JSON.parse(toolCall.function.arguments);
|
|
94
|
+
return (() => { const _io0 = input => "string" === typeof input.content && "string" === typeof input.reply; return input => "object" === typeof input && null !== input && _io0(input); })()(input) ? input.reply : null;
|
|
95
|
+
});
|
|
96
|
+
/**
|
|
97
|
+
* Check if the called operations match the expected operations.
|
|
98
|
+
*
|
|
99
|
+
* @param props Properties for checking the match of the called operations
|
|
100
|
+
* and the expected operations
|
|
101
|
+
*
|
|
102
|
+
* @returns `true` if the called operations match the expected operations,
|
|
103
|
+
* otherwise `false`.
|
|
104
|
+
*/
|
|
105
|
+
AgenticaBenchmarkPredicator.success = (props) => successInner(props).result;
|
|
106
|
+
const successInner = (props) => {
|
|
107
|
+
const call = (expected, overrideOperations) => successInner({
|
|
108
|
+
expected,
|
|
109
|
+
operations: overrideOperations !== null && overrideOperations !== void 0 ? overrideOperations : props.operations,
|
|
110
|
+
strict: props.strict,
|
|
111
|
+
});
|
|
112
|
+
switch (props.expected.type) {
|
|
113
|
+
case "array": {
|
|
114
|
+
let take = 0;
|
|
115
|
+
const targetIterator = props.expected.items[Symbol.iterator]();
|
|
116
|
+
let targeted = targetIterator.next();
|
|
117
|
+
while (true) {
|
|
118
|
+
if (targeted.done) {
|
|
119
|
+
return {
|
|
120
|
+
result: true,
|
|
121
|
+
take,
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
if (take >= props.operations.length) {
|
|
125
|
+
return { result: false };
|
|
126
|
+
}
|
|
127
|
+
const result = call(targeted.value, props.operations.slice(take));
|
|
128
|
+
if (!result.result) {
|
|
129
|
+
if (!props.strict) {
|
|
130
|
+
take += 1;
|
|
131
|
+
continue;
|
|
132
|
+
}
|
|
133
|
+
return { result: false };
|
|
134
|
+
}
|
|
135
|
+
take += result.take;
|
|
136
|
+
targeted = targetIterator.next();
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
case "standalone": {
|
|
140
|
+
const target = props.expected.operation;
|
|
141
|
+
const result = props.operations.some((op) => op.name === target.name);
|
|
142
|
+
if (result) {
|
|
143
|
+
return { result, take: 1 };
|
|
144
|
+
}
|
|
145
|
+
return {
|
|
146
|
+
result,
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
case "anyOf":
|
|
150
|
+
for (const expected of props.expected.anyOf) {
|
|
151
|
+
const callResult = call(expected);
|
|
152
|
+
if (callResult.result) {
|
|
153
|
+
return callResult;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
return { result: false };
|
|
157
|
+
case "allOf": {
|
|
158
|
+
/**
|
|
159
|
+
* @example
|
|
160
|
+
* expected = [4, 2];
|
|
161
|
+
* called = [1, 2, 3, 4, 5];
|
|
162
|
+
*
|
|
163
|
+
* { result: true, take: 3 };
|
|
164
|
+
*/
|
|
165
|
+
const result = props.expected.allOf.map((expected) => call(expected));
|
|
166
|
+
if (result.every((r) => r.result)) {
|
|
167
|
+
return {
|
|
168
|
+
result: true,
|
|
169
|
+
take: result.reduce((acc, r) => Math.max(acc, r.take), 0),
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
return {
|
|
173
|
+
result: false,
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
})(AgenticaBenchmarkPredicator || (exports.AgenticaBenchmarkPredicator = AgenticaBenchmarkPredicator = {}));
|
|
179
|
+
//# sourceMappingURL=AgenticaBenchmarkPredicator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AgenticaBenchmarkPredicator.js","sourceRoot":"","sources":["../../src/internal/AgenticaBenchmarkPredicator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAGA,kDAA0B;AAI1B,IAAiB,2BAA2B,CAgL3C;AAhLD,WAAiB,2BAA2B;IAC7B,kCAAM,GAAG,CAAO,KAAe,EAA0B,EAAE;;QACtE,MAAM,IAAI,GAAgC,KAAK,CAAC,kBAAkB,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QAC5E,IAAI,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,IAAI,MAAK,MAAM,IAAI,IAAI,CAAC,IAAI,KAAK,WAAW;YAAE,OAAO,IAAI,CAAC;QAEpE,MAAM,OAAO,GAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAGrC,SAAS,CAAC,CAAC,CAAE,CAAC;QAClB,MAAM,MAAM,GAA0B,MAAM,KAAK,CAC/C,OAAO,CACR,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CACpC;YACE,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,KAAK;YACpC,QAAQ,EAAE;gBACR;oBACE,IAAI,EAAE,QAAQ;oBACd,OAAO,EAAE;wBACP,+BAA+B;wBAC/B,EAAE;wBACF,qDAAqD;wBACrD,8DAA8D;wBAC9D,kDAAkD;qBACnD,CAAC,IAAI,CAAC,IAAI,CAAC;iBACb;gBACD;oBACE,IAAI,EAAE,WAAW;oBACjB,OAAO,EAAE,IAAI,CAAC,IAAI;iBACnB;aACF;YACD,KAAK,EAAE;gBACL;oBACE,IAAI,EAAE,UAAU;oBAChB,QAAQ,E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
exports.AgenticaBenchmarkUtil = void 0;
|
|
4
|
+
var AgenticaBenchmarkUtil;
|
|
5
|
+
(function (AgenticaBenchmarkUtil) {
|
|
6
|
+
AgenticaBenchmarkUtil.errorToJson = (error) => {
|
|
7
|
+
if (error instanceof Error)
|
|
8
|
+
return Object.assign(Object.assign({}, error), { name: error.name, message: error.message, stack: error.stack });
|
|
9
|
+
return error;
|
|
10
|
+
};
|
|
11
|
+
AgenticaBenchmarkUtil.expectedToJson = (expected) => {
|
|
12
|
+
if (expected.type === "standalone")
|
|
13
|
+
return {
|
|
14
|
+
type: expected.type,
|
|
15
|
+
operation: {
|
|
16
|
+
name: expected.operation.name,
|
|
17
|
+
description: expected.operation.function.description,
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
else if (expected.type === "array")
|
|
21
|
+
return {
|
|
22
|
+
type: expected.type,
|
|
23
|
+
items: expected.items.map(AgenticaBenchmarkUtil.expectedToJson),
|
|
24
|
+
};
|
|
25
|
+
else if (expected.type === "allOf")
|
|
26
|
+
return {
|
|
27
|
+
type: expected.type,
|
|
28
|
+
allOf: expected.allOf.map(AgenticaBenchmarkUtil.expectedToJson),
|
|
29
|
+
};
|
|
30
|
+
else
|
|
31
|
+
return {
|
|
32
|
+
type: expected.type,
|
|
33
|
+
anyOf: expected.anyOf.map(AgenticaBenchmarkUtil.expectedToJson),
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
})(AgenticaBenchmarkUtil || (exports.AgenticaBenchmarkUtil = AgenticaBenchmarkUtil = {}));
|
|
37
|
+
//# sourceMappingURL=AgenticaBenchmarkUtil.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AgenticaBenchmarkUtil.js","sourceRoot":"","sources":["../../src/internal/AgenticaBenchmarkUtil.ts"],"names":[],"mappings":";;;AAEA,IAAiB,qBAAqB,CAqCrC;AArCD,WAAiB,qBAAqB;IACvB,iCAAW,GAAG,CAAC,KAAU,EAAO,EAAE;QAC7C,IAAI,KAAK,YAAY,KAAK;YACxB,uCACK,KAAK,KACR,IAAI,EAAE,KAAK,CAAC,IAAI,EAChB,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,KAAK,EAAE,KAAK,CAAC,KAAK,IAClB;QACJ,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IAEW,oCAAc,GAAG,CAAC,QAAoC,EAAO,EAAE;QAC1E,IAAI,QAAQ,CAAC,IAAI,KAAK,YAAY;YAChC,OAAO;gBACL,IAAI,EAAE,QAAQ,CAAC,IAAI;gBACnB,SAAS,EAAE;oBACT,IAAI,EAAE,QAAQ,CAAC,SAAS,CAAC,IAAI;oBAC7B,WAAW,EAAE,QAAQ,CAAC,SAAS,CAAC,QAAQ,CAAC,WAAW;iBACrD;aACF,CAAC;aACC,IAAI,QAAQ,CAAC,IAAI,KAAK,OAAO;YAChC,OAAO;gBACL,IAAI,EAAE,QAAQ,CAAC,IAAI;gBACnB,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,sBAAA,cAAc,CAAC;aAC1C,CAAC;aACC,IAAI,QAAQ,CAAC,IAAI,KAAK,OAAO;YAChC,OAAO;gBACL,IAAI,EAAE,QAAQ,CAAC,IAAI;gBACnB,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,sBAAA,cAAc,CAAC;aAC1C,CAAC;;YAEF,OAAO;gBACL,IAAI,EAAE,QAAQ,CAAC,IAAI;gBACnB,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,sBAAA,cAAc,CAAC;aAC1C,CAAC;IACN,CAAC,CAAC;AACJ,CAAC,EArCgB,qBAAqB,qCAArB,qBAAqB,QAqCrC"}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AgenticaCallBenchmarkReporter = void 0;
|
|
4
|
+
const MathUtil_1 = require("../utils/MathUtil");
|
|
5
|
+
const AgenticaBenchmarkUtil_1 = require("./AgenticaBenchmarkUtil");
|
|
6
|
+
const AgenticaPromptReporter_1 = require("./AgenticaPromptReporter");
|
|
7
|
+
var AgenticaCallBenchmarkReporter;
|
|
8
|
+
(function (AgenticaCallBenchmarkReporter) {
|
|
9
|
+
AgenticaCallBenchmarkReporter.markdown = (result) => Object.fromEntries([
|
|
10
|
+
["./README.md", writeIndex(result)],
|
|
11
|
+
...result.experiments
|
|
12
|
+
.map((exp) => [
|
|
13
|
+
[`./${exp.scenario.name}/README.md`, writeExperimentIndex(exp)],
|
|
14
|
+
...exp.events.map((event, i) => [
|
|
15
|
+
`./${exp.scenario.name}/${i + 1}.${event.type}.md`,
|
|
16
|
+
writeExperimentEvent(event, i),
|
|
17
|
+
]),
|
|
18
|
+
])
|
|
19
|
+
.flat(),
|
|
20
|
+
]);
|
|
21
|
+
const writeIndex = (result) => {
|
|
22
|
+
const events = result.experiments
|
|
23
|
+
.map((r) => r.events)
|
|
24
|
+
.flat();
|
|
25
|
+
const average = events
|
|
26
|
+
.map((e) => e.completed_at.getTime() - e.started_at.getTime())
|
|
27
|
+
.reduce((a, b) => a + b, 0) / events.length;
|
|
28
|
+
return [
|
|
29
|
+
"# LLM Function Call Benchmark",
|
|
30
|
+
"## Summary",
|
|
31
|
+
` - Aggregation:`,
|
|
32
|
+
` - Scenarios: #${result.experiments.length.toLocaleString()}`,
|
|
33
|
+
` - Trial: ${events.length}`,
|
|
34
|
+
` - Success: ${events.filter((e) => e.type === "success").length}`,
|
|
35
|
+
` - Failure: ${events.filter((e) => e.type === "failure").length}`,
|
|
36
|
+
` - Average Time: ${MathUtil_1.MathUtil.round(average).toLocaleString()} ms`,
|
|
37
|
+
` - Token Usage`,
|
|
38
|
+
` - Total: ${result.usage.total.toLocaleString()}`,
|
|
39
|
+
` - Prompt`,
|
|
40
|
+
` - Total: ${result.usage.prompt.total.toLocaleString()}`,
|
|
41
|
+
` - Audio: ${result.usage.prompt.audio.toLocaleString()}`,
|
|
42
|
+
` - Cached: ${result.usage.prompt.cached.toLocaleString()}`,
|
|
43
|
+
` - Completion:`,
|
|
44
|
+
` - Total: ${result.usage.completion.total.toLocaleString()}`,
|
|
45
|
+
` - Accepted Prediction: ${result.usage.completion.accepted_prediction.toLocaleString()}`,
|
|
46
|
+
` - Audio: ${result.usage.completion.audio.toLocaleString()}`,
|
|
47
|
+
` - Reasoning: ${result.usage.completion.reasoning.toLocaleString()}`,
|
|
48
|
+
` - Rejected Prediction: ${result.usage.completion.rejected_prediction.toLocaleString()}`,
|
|
49
|
+
"",
|
|
50
|
+
"## Experiments",
|
|
51
|
+
" Name | Select | Call | Time/Avg ",
|
|
52
|
+
":-----|:-------|:-----|----------:",
|
|
53
|
+
...result.experiments.map((exp) => [
|
|
54
|
+
`[${exp.scenario.name}](./${exp.scenario.name}/README.md)`,
|
|
55
|
+
drawStatus(exp.events, (e) => e.type !== "error" && e.select === true),
|
|
56
|
+
drawStatus(exp.events, (e) => e.type !== "error" && e.call === true),
|
|
57
|
+
`${MathUtil_1.MathUtil.round(exp.events
|
|
58
|
+
.map((e) => e.completed_at.getTime() - e.started_at.getTime())
|
|
59
|
+
.reduce((a, b) => a + b, 0) / exp.events.length).toLocaleString()} ms`,
|
|
60
|
+
].join(" | ")),
|
|
61
|
+
].join("\n");
|
|
62
|
+
};
|
|
63
|
+
const writeExperimentIndex = (exp) => {
|
|
64
|
+
return [
|
|
65
|
+
`# ${exp.scenario.name}`,
|
|
66
|
+
"## Summary",
|
|
67
|
+
` - Scenarios: #${exp.events.length.toLocaleString()}`,
|
|
68
|
+
` - Success: ${exp.events.filter((e) => e.type === "success").length}`,
|
|
69
|
+
` - Failure: ${exp.events.filter((e) => e.type === "failure").length}`,
|
|
70
|
+
` - Average Time: ${MathUtil_1.MathUtil.round(exp.events
|
|
71
|
+
.map((e) => e.completed_at.getTime() - e.started_at.getTime())
|
|
72
|
+
.reduce((a, b) => a + b, 0) / exp.events.length).toLocaleString()} ms`,
|
|
73
|
+
"",
|
|
74
|
+
"## Events",
|
|
75
|
+
" Name | Type | Time",
|
|
76
|
+
":-----|:-----|----:",
|
|
77
|
+
...exp.events.map((e, i) => [
|
|
78
|
+
`[${i + 1}.](./${i + 1}.${e.type}.md)`,
|
|
79
|
+
e.type,
|
|
80
|
+
`${MathUtil_1.MathUtil.round(e.completed_at.getTime() - e.started_at.getTime())} ms`,
|
|
81
|
+
].join(" | ")),
|
|
82
|
+
"",
|
|
83
|
+
"## Scenario",
|
|
84
|
+
"### User Prompt",
|
|
85
|
+
exp.scenario.text,
|
|
86
|
+
"",
|
|
87
|
+
"### Expected",
|
|
88
|
+
"```json",
|
|
89
|
+
JSON.stringify(AgenticaBenchmarkUtil_1.AgenticaBenchmarkUtil.expectedToJson(exp.scenario.expected), null, 2),
|
|
90
|
+
"```",
|
|
91
|
+
].join("\n");
|
|
92
|
+
};
|
|
93
|
+
const writeExperimentEvent = (event, index) => {
|
|
94
|
+
return [
|
|
95
|
+
`# ${index}. ${event.type}`,
|
|
96
|
+
"## Summary",
|
|
97
|
+
` - Name: ${event.scenario.name}`,
|
|
98
|
+
` - Type: ${event.type}`,
|
|
99
|
+
` - Time: ${MathUtil_1.MathUtil.round(event.completed_at.getTime() - event.started_at.getTime()).toLocaleString()} ms`,
|
|
100
|
+
...(event.type !== "error"
|
|
101
|
+
? [
|
|
102
|
+
` - Select: ${event.select ? "✅" : "❌"}`,
|
|
103
|
+
` - Call: ${event.call ? "✅" : "❌"}`,
|
|
104
|
+
]
|
|
105
|
+
: []),
|
|
106
|
+
` - Token Usage: ${event.usage.toLocaleString()}`,
|
|
107
|
+
"",
|
|
108
|
+
"## Scenario",
|
|
109
|
+
"### User Prompt",
|
|
110
|
+
event.scenario.text,
|
|
111
|
+
"",
|
|
112
|
+
"### Expected",
|
|
113
|
+
"```json",
|
|
114
|
+
JSON.stringify(AgenticaBenchmarkUtil_1.AgenticaBenchmarkUtil.expectedToJson(event.scenario.expected), null, 2),
|
|
115
|
+
"```",
|
|
116
|
+
"",
|
|
117
|
+
"## Prompt Histories",
|
|
118
|
+
...event.prompts.map(AgenticaPromptReporter_1.AgenticaPromptReporter.markdown),
|
|
119
|
+
"",
|
|
120
|
+
...(event.type === "error"
|
|
121
|
+
? [
|
|
122
|
+
"## Error",
|
|
123
|
+
"```json",
|
|
124
|
+
JSON.stringify(AgenticaBenchmarkUtil_1.AgenticaBenchmarkUtil.errorToJson(event.error), null, 2),
|
|
125
|
+
"```",
|
|
126
|
+
]
|
|
127
|
+
: []),
|
|
128
|
+
].join("\n");
|
|
129
|
+
};
|
|
130
|
+
const drawStatus = (events, success) => {
|
|
131
|
+
const count = events.filter(success).length;
|
|
132
|
+
return (new Array(count).fill("■").join("") +
|
|
133
|
+
new Array(10 - count).fill("□").join(""));
|
|
134
|
+
};
|
|
135
|
+
})(AgenticaCallBenchmarkReporter || (exports.AgenticaCallBenchmarkReporter = AgenticaCallBenchmarkReporter = {}));
|
|
136
|
+
//# sourceMappingURL=AgenticaCallBenchmarkReporter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AgenticaCallBenchmarkReporter.js","sourceRoot":"","sources":["../../src/internal/AgenticaCallBenchmarkReporter.ts"],"names":[],"mappings":";;;AAEA,gDAA6C;AAC7C,mEAAgE;AAChE,qEAAkE;AAElE,IAAiB,6BAA6B,CA0K7C;AA1KD,WAAiB,6BAA6B;IAC/B,sCAAQ,GAAG,CACtB,MAAoC,EACZ,EAAE,CAC1B,MAAM,CAAC,WAAW,CAAC;QACjB,CAAC,aAAa,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC;QACnC,GAAG,MAAM,CAAC,WAAW;aAClB,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC;YACZ,CAAC,KAAK,GAAG,CAAC,QAAQ,CAAC,IAAI,YAAY,EAAE,oBAAoB,CAAC,GAAG,CAAC,CAAC;YAC/D,GAAG,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK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,EAAE,CAAC,CACzC,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC,EA1KgB,6BAA6B,6CAA7B,6BAA6B,QA0K7C"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AgenticaPromptReporter = void 0;
|
|
4
|
+
var AgenticaPromptReporter;
|
|
5
|
+
(function (AgenticaPromptReporter) {
|
|
6
|
+
AgenticaPromptReporter.markdown = (p) => {
|
|
7
|
+
if (p.type === "text")
|
|
8
|
+
return [`### Text (${p.role})`, p.text, ""].join("\n");
|
|
9
|
+
else if (p.type === "select" || p.type === "cancel")
|
|
10
|
+
return [
|
|
11
|
+
`### ${p.type === "select" ? "Select" : "Cancel"}`,
|
|
12
|
+
...p.operations
|
|
13
|
+
.map((op) => {
|
|
14
|
+
var _a;
|
|
15
|
+
return [
|
|
16
|
+
`#### ${op.name}`,
|
|
17
|
+
` - controller: ${op.controller.name}`,
|
|
18
|
+
` - function: ${op.function.name}`,
|
|
19
|
+
` - reason: ${op.reason}`,
|
|
20
|
+
"",
|
|
21
|
+
...(!!((_a = op.function.description) === null || _a === void 0 ? void 0 : _a.length)
|
|
22
|
+
? [op.function.description, ""]
|
|
23
|
+
: []),
|
|
24
|
+
];
|
|
25
|
+
})
|
|
26
|
+
.flat(),
|
|
27
|
+
].join("\n");
|
|
28
|
+
else if (p.type === "describe")
|
|
29
|
+
return [
|
|
30
|
+
"### Describe",
|
|
31
|
+
...p.executions.map((e) => ` - ${e.name}`),
|
|
32
|
+
"",
|
|
33
|
+
...p.text.split("\n").map((s) => `> ${s}`),
|
|
34
|
+
"",
|
|
35
|
+
].join("\n");
|
|
36
|
+
return [
|
|
37
|
+
"### Execute",
|
|
38
|
+
` - name: ${p.name}`,
|
|
39
|
+
` - controller: ${p.controller.name}`,
|
|
40
|
+
` - function: ${p.function.name}`,
|
|
41
|
+
"",
|
|
42
|
+
"```json",
|
|
43
|
+
JSON.stringify(p.arguments, null, 2),
|
|
44
|
+
"```",
|
|
45
|
+
"",
|
|
46
|
+
].join("\n");
|
|
47
|
+
};
|
|
48
|
+
})(AgenticaPromptReporter || (exports.AgenticaPromptReporter = AgenticaPromptReporter = {}));
|
|
49
|
+
//# sourceMappingURL=AgenticaPromptReporter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AgenticaPromptReporter.js","sourceRoot":"","sources":["../../src/internal/AgenticaPromptReporter.ts"],"names":[],"mappings":";;;AAEA,IAAiB,sBAAsB,CAwCtC;AAxCD,WAAiB,sBAAsB;IACxB,+BAAQ,GAAG,CAAC,CAAkB,EAAU,EAAE;QACrD,IAAI,CAAC,CAAC,IAAI,KAAK,MAAM;YACnB,OAAO,CAAC,aAAa,CAAC,CAAC,IAAI,GAAG,EAAE,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;aACpD,IAAI,CAAC,CAAC,IAAI,KAAK,QAAQ,IAAI,CAAC,CAAC,IAAI,KAAK,QAAQ;YACjD,OAAO;gBACL,OAAO,CAAC,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,EAAE;gBAClD,GAAG,CAAC,CAAC,UAAU;qBACZ,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE;;oBAAC,OAAA;wBACX,QAAQ,EAAE,CAAC,IAAI,EAAE;wBACjB,mBAAmB,EAAE,CAAC,UAAU,CAAC,IAAI,EAAE;wBACvC,iBAAiB,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE;wBACnC,eAAe,EAAE,CAAC,MAAM,EAAE;wBAC1B,EAAE;wBACF,GAAG,CAAC,CAAC,CAAC,CAAA,MAAA,EAAE,CAAC,QAAQ,CAAC,WAAW,0CAAE,MAAM,CAAA;4BACnC,CAAC,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,WAAW,EAAE,EAAE,CAAC;4BAC/B,CAAC,CAAC,EAAE,CAAC;qBACR,CAAA;iBAAA,CAAC;qBACD,IAAI,EAAE;aACV,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;aACV,IAAI,CAAC,CAAC,IAAI,KAAK,UAAU;YAC5B,OAAO;gBACL,cAAc;gBACd,GAAG,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC;gBAC3C,EAAE;gBACF,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC;gBAC1C,EAAE;aACH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACf,OAAO;YACL,aAAa;YACb,aAAa,CAAC,CAAC,IAAI,EAAE;YACrB,mBAAmB,CAAC,CAAC,UAAU,CAAC,IAAI,EAAE;YACtC,iBAAiB,CAAC,CAAC,QAAQ,CAAC,IAAI,EAAE;YAClC,EAAE;YACF,SAAS;YACT,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;YACpC,KAAK;YACL,EAAE;SACH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACf,CAAC,CAAC;AACJ,CAAC,EAxCgB,sBAAsB,sCAAtB,sBAAsB,QAwCtC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AgenticaSelectBenchmarkReporter = void 0;
|
|
4
|
+
const MathUtil_1 = require("../utils/MathUtil");
|
|
5
|
+
const AgenticaBenchmarkUtil_1 = require("./AgenticaBenchmarkUtil");
|
|
6
|
+
/**
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
var AgenticaSelectBenchmarkReporter;
|
|
10
|
+
(function (AgenticaSelectBenchmarkReporter) {
|
|
11
|
+
AgenticaSelectBenchmarkReporter.markdown = (result) => Object.fromEntries([
|
|
12
|
+
["./README.md", writeIndex(result)],
|
|
13
|
+
...result.experiments
|
|
14
|
+
.map((exp) => [
|
|
15
|
+
[`./${exp.scenario.name}/README.md`, writeExperimentIndex(exp)],
|
|
16
|
+
...exp.events.map((event, i) => [
|
|
17
|
+
`./${exp.scenario.name}/${i + 1}.${event.type}.md`,
|
|
18
|
+
writeExperimentEvent(event, i),
|
|
19
|
+
]),
|
|
20
|
+
])
|
|
21
|
+
.flat(),
|
|
22
|
+
]);
|
|
23
|
+
const writeIndex = (result) => {
|
|
24
|
+
const events = result.experiments
|
|
25
|
+
.map((r) => r.events)
|
|
26
|
+
.flat();
|
|
27
|
+
const average = events
|
|
28
|
+
.map((e) => e.completed_at.getTime() - e.started_at.getTime())
|
|
29
|
+
.reduce((a, b) => a + b, 0) / events.length;
|
|
30
|
+
return [
|
|
31
|
+
"# LLM Function Selection Benchmark",
|
|
32
|
+
"## Summary",
|
|
33
|
+
` - Aggregation:`,
|
|
34
|
+
` - Scenarios: #${result.experiments.length.toLocaleString()}`,
|
|
35
|
+
` - Trial: ${events.length}`,
|
|
36
|
+
` - Success: ${events.filter((e) => e.type === "success").length}`,
|
|
37
|
+
` - Failure: ${events.filter((e) => e.type === "failure").length}`,
|
|
38
|
+
` - Average Time: ${MathUtil_1.MathUtil.round(average).toLocaleString()} ms`,
|
|
39
|
+
` - Token Usage`,
|
|
40
|
+
` - Total: ${result.usage.total.toLocaleString()}`,
|
|
41
|
+
` - Prompt`,
|
|
42
|
+
` - Total: ${result.usage.prompt.total.toLocaleString()}`,
|
|
43
|
+
` - Audio: ${result.usage.prompt.audio.toLocaleString()}`,
|
|
44
|
+
` - Cached: ${result.usage.prompt.cached.toLocaleString()}`,
|
|
45
|
+
` - Completion:`,
|
|
46
|
+
` - Total: ${result.usage.completion.total.toLocaleString()}`,
|
|
47
|
+
` - Accepted Prediction: ${result.usage.completion.accepted_prediction.toLocaleString()}`,
|
|
48
|
+
` - Audio: ${result.usage.completion.audio.toLocaleString()}`,
|
|
49
|
+
` - Reasoning: ${result.usage.completion.reasoning.toLocaleString()}`,
|
|
50
|
+
` - Rejected Prediction: ${result.usage.completion.rejected_prediction.toLocaleString()}`,
|
|
51
|
+
"",
|
|
52
|
+
"## Experiments",
|
|
53
|
+
" Name | Status | Time/Avg ",
|
|
54
|
+
":-----|:-------|----------:",
|
|
55
|
+
...result.experiments.map((exp) => [
|
|
56
|
+
`[${exp.scenario.name}](./${exp.scenario.name}/README.md)`,
|
|
57
|
+
(() => {
|
|
58
|
+
const success = Math.floor((exp.events.filter((e) => e.type === "success").length /
|
|
59
|
+
exp.events.length) *
|
|
60
|
+
10);
|
|
61
|
+
return (new Array(success).fill("■").join("") +
|
|
62
|
+
new Array(10 - success).fill("□").join(""));
|
|
63
|
+
})(),
|
|
64
|
+
MathUtil_1.MathUtil.round(exp.events
|
|
65
|
+
.map((event) => event.completed_at.getTime() - event.started_at.getTime())
|
|
66
|
+
.reduce((a, b) => a + b, 0) / exp.events.length).toLocaleString() + " ms",
|
|
67
|
+
].join(" | ")),
|
|
68
|
+
].join("\n");
|
|
69
|
+
};
|
|
70
|
+
const writeExperimentIndex = (exp) => {
|
|
71
|
+
return [
|
|
72
|
+
`# ${exp.scenario.name}`,
|
|
73
|
+
"## Summary",
|
|
74
|
+
" - Aggregation:",
|
|
75
|
+
` - Trial: ${exp.events.length}`,
|
|
76
|
+
` - Success: ${exp.events.filter((e) => e.type === "success").length}`,
|
|
77
|
+
` - Failure: ${exp.events.filter((e) => e.type === "failure").length}`,
|
|
78
|
+
` - Average Time: ${MathUtil_1.MathUtil.round(exp.events
|
|
79
|
+
.map((event) => event.completed_at.getTime() - event.started_at.getTime())
|
|
80
|
+
.reduce((a, b) => a + b, 0) / exp.events.length).toLocaleString()} ms`,
|
|
81
|
+
" - Token Usage",
|
|
82
|
+
` - Total: ${exp.usage.total.toLocaleString()}`,
|
|
83
|
+
` - Prompt`,
|
|
84
|
+
` - Total: ${exp.usage.prompt.total.toLocaleString()}`,
|
|
85
|
+
` - Audio: ${exp.usage.prompt.audio.toLocaleString()}`,
|
|
86
|
+
` - Cached: ${exp.usage.prompt.cached.toLocaleString()}`,
|
|
87
|
+
` - Completion:`,
|
|
88
|
+
` - Total: ${exp.usage.completion.total.toLocaleString()}`,
|
|
89
|
+
` - Accepted Prediction: ${exp.usage.completion.accepted_prediction.toLocaleString()}`,
|
|
90
|
+
` - Audio: ${exp.usage.completion.audio.toLocaleString()}`,
|
|
91
|
+
` - Reasoning: ${exp.usage.completion.reasoning.toLocaleString()}`,
|
|
92
|
+
` - Rejected Prediction: ${exp.usage.completion.rejected_prediction.toLocaleString()}`,
|
|
93
|
+
"",
|
|
94
|
+
"## Events",
|
|
95
|
+
" No | Type | Time",
|
|
96
|
+
"---:|:-----|----:",
|
|
97
|
+
...exp.events.map((e, i) => [
|
|
98
|
+
`[${i + 1}.](./${i + 1}.${e.type}.md)`,
|
|
99
|
+
e.type,
|
|
100
|
+
MathUtil_1.MathUtil.round(e.completed_at.getTime() - e.started_at.getTime()) +
|
|
101
|
+
" ms",
|
|
102
|
+
].join(" | ")),
|
|
103
|
+
"",
|
|
104
|
+
"## Scenario",
|
|
105
|
+
"### User Prompt",
|
|
106
|
+
exp.scenario.text,
|
|
107
|
+
"",
|
|
108
|
+
"### Expected",
|
|
109
|
+
"```json",
|
|
110
|
+
JSON.stringify(AgenticaBenchmarkUtil_1.AgenticaBenchmarkUtil.expectedToJson(exp.scenario.expected), null, 2),
|
|
111
|
+
"```",
|
|
112
|
+
].join("\n");
|
|
113
|
+
};
|
|
114
|
+
const writeExperimentEvent = (event, index) => {
|
|
115
|
+
return [
|
|
116
|
+
`# ${index}. ${event.type}`,
|
|
117
|
+
`## Summary`,
|
|
118
|
+
` - Name: ${event.scenario.name}`,
|
|
119
|
+
` - Type: ${event.type}`,
|
|
120
|
+
` - Time: ${(event.completed_at.getTime() - event.started_at.getTime()).toLocaleString()} ms`,
|
|
121
|
+
...(event.type !== "error"
|
|
122
|
+
? [
|
|
123
|
+
" - Token Usage",
|
|
124
|
+
` - Total: ${event.usage.total.toLocaleString()}`,
|
|
125
|
+
` - Prompt`,
|
|
126
|
+
` - Total: ${event.usage.prompt.total.toLocaleString()}`,
|
|
127
|
+
` - Audio: ${event.usage.prompt.audio.toLocaleString()}`,
|
|
128
|
+
` - Cached: ${event.usage.prompt.cached.toLocaleString()}`,
|
|
129
|
+
` - Completion:`,
|
|
130
|
+
` - Total: ${event.usage.completion.total.toLocaleString()}`,
|
|
131
|
+
` - Accepted Prediction: ${event.usage.completion.accepted_prediction.toLocaleString()}`,
|
|
132
|
+
` - Audio: ${event.usage.completion.audio.toLocaleString()}`,
|
|
133
|
+
` - Reasoning: ${event.usage.completion.reasoning.toLocaleString()}`,
|
|
134
|
+
` - Rejected Prediction: ${event.usage.completion.rejected_prediction.toLocaleString()}`,
|
|
135
|
+
]
|
|
136
|
+
: []),
|
|
137
|
+
"",
|
|
138
|
+
"## Scenario",
|
|
139
|
+
"### User Prompt",
|
|
140
|
+
event.scenario.text,
|
|
141
|
+
"",
|
|
142
|
+
"### Expected",
|
|
143
|
+
"```json",
|
|
144
|
+
JSON.stringify(AgenticaBenchmarkUtil_1.AgenticaBenchmarkUtil.expectedToJson(event.scenario.expected), null, 2),
|
|
145
|
+
"```",
|
|
146
|
+
"",
|
|
147
|
+
...(event.type === "success" || event.type === "failure"
|
|
148
|
+
? [
|
|
149
|
+
"## Result",
|
|
150
|
+
...event.selected.map((s) => [
|
|
151
|
+
`### ${s.name}`,
|
|
152
|
+
` - Controller: \`${s.controller.name}\``,
|
|
153
|
+
` - Function: \`${s.function.name}\``,
|
|
154
|
+
` - Reason: ${s.reason}`,
|
|
155
|
+
"",
|
|
156
|
+
...(s.function.description ? [s.function.description, ""] : []),
|
|
157
|
+
].join("\n")),
|
|
158
|
+
]
|
|
159
|
+
: []),
|
|
160
|
+
...(event.type === "error"
|
|
161
|
+
? [
|
|
162
|
+
"## Error",
|
|
163
|
+
"```json",
|
|
164
|
+
AgenticaBenchmarkUtil_1.AgenticaBenchmarkUtil.errorToJson(JSON.stringify(event.error, null, 2)),
|
|
165
|
+
"```",
|
|
166
|
+
"",
|
|
167
|
+
]
|
|
168
|
+
: []),
|
|
169
|
+
].join("\n");
|
|
170
|
+
};
|
|
171
|
+
})(AgenticaSelectBenchmarkReporter || (exports.AgenticaSelectBenchmarkReporter = AgenticaSelectBenchmarkReporter = {}));
|
|
172
|
+
//# sourceMappingURL=AgenticaSelectBenchmarkReporter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AgenticaSelectBenchmarkReporter.js","sourceRoot":"","sources":["../../src/internal/AgenticaSelectBenchmarkReporter.ts"],"names":[],"mappings":";;;AAEA,gDAA6C;AAC7C,mEAAgE;AAEhE;;GAEG;AACH,IAAiB,+BAA+B,CA2M/C;AA3MD,WAAiB,+BAA+B;IACjC,wCAAQ,GAAG,CACtB,MAAsC,EACd,EAAE,CAC1B,MAAM,CAAC,WAAW,CAAC;QACjB,CAAC,aAAa,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC;QACnC,GAAG,MAAM,CAAC,WAAW;aAClB,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC;YACZ,CAAC,KAAK,GAAG,CAAC,QAAQ,CAAC,IAAI,YAAY,EAAE,oBAAoB,CAAC,GAAG,CAAC,CAAC;YAC/D,GAAG,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC;gBAC9B,KAAK,GAAG,CAAC,QAAQ,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,IAAI,KAAK;gBAClD,oBAAoB,CAAC,KAAK,EAAE,CAAC,CAAC;aAC/B,CAAC;SACH,CAAC;aACD,IAAI,EA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