@agentica/benchmark 0.12.21 → 0.13.0

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.
Files changed (50) hide show
  1. package/README.md +39 -33
  2. package/lib/AgenticaCallBenchmark.d.ts +12 -6
  3. package/lib/AgenticaCallBenchmark.js +24 -18
  4. package/lib/AgenticaCallBenchmark.js.map +1 -1
  5. package/lib/AgenticaSelectBenchmark.d.ts +12 -6
  6. package/lib/AgenticaSelectBenchmark.js +14 -12
  7. package/lib/AgenticaSelectBenchmark.js.map +1 -1
  8. package/lib/index.mjs +315 -236
  9. package/lib/index.mjs.map +1 -1
  10. package/lib/internal/AgenticaBenchmarkPredicator.d.ts +38 -29
  11. package/lib/internal/AgenticaBenchmarkPredicator.js +100 -84
  12. package/lib/internal/AgenticaBenchmarkPredicator.js.map +1 -1
  13. package/lib/internal/AgenticaBenchmarkUtil.d.ts +21 -6
  14. package/lib/internal/AgenticaBenchmarkUtil.js +39 -33
  15. package/lib/internal/AgenticaBenchmarkUtil.js.map +1 -1
  16. package/lib/internal/AgenticaCallBenchmarkReporter.d.ts +6 -5
  17. package/lib/internal/AgenticaCallBenchmarkReporter.js +130 -126
  18. package/lib/internal/AgenticaCallBenchmarkReporter.js.map +1 -1
  19. package/lib/internal/AgenticaPromptReporter.d.ts +13 -5
  20. package/lib/internal/AgenticaPromptReporter.js +45 -41
  21. package/lib/internal/AgenticaPromptReporter.js.map +1 -1
  22. package/lib/internal/AgenticaSelectBenchmarkReporter.d.ts +3 -1
  23. package/lib/internal/AgenticaSelectBenchmarkReporter.js +153 -150
  24. package/lib/internal/AgenticaSelectBenchmarkReporter.js.map +1 -1
  25. package/lib/structures/IAgenticaBenchmarkExpected.d.ts +8 -2
  26. package/lib/structures/IAgenticaCallBenchmarkEvent.d.ts +9 -3
  27. package/lib/structures/IAgenticaCallBenchmarkResult.d.ts +10 -4
  28. package/lib/structures/IAgenticaCallBenchmarkScenario.d.ts +8 -2
  29. package/lib/structures/IAgenticaSelectBenchmarkEvent.d.ts +9 -3
  30. package/lib/structures/IAgenticaSelectBenchmarkResult.d.ts +10 -4
  31. package/lib/structures/IAgenticaSelectBenchmarkScenario.d.ts +8 -2
  32. package/lib/utils/MathUtil.d.ts +15 -3
  33. package/lib/utils/MathUtil.js +15 -4
  34. package/lib/utils/MathUtil.js.map +1 -1
  35. package/package.json +12 -10
  36. package/src/AgenticaCallBenchmark.ts +64 -45
  37. package/src/AgenticaSelectBenchmark.ts +42 -30
  38. package/src/internal/AgenticaBenchmarkPredicator.ts +208 -186
  39. package/src/internal/AgenticaBenchmarkUtil.ts +58 -40
  40. package/src/internal/AgenticaCallBenchmarkReporter.ts +180 -182
  41. package/src/internal/AgenticaPromptReporter.ts +46 -33
  42. package/src/internal/AgenticaSelectBenchmarkReporter.ts +205 -203
  43. package/src/structures/IAgenticaBenchmarkExpected.ts +9 -2
  44. package/src/structures/IAgenticaCallBenchmarkEvent.ts +9 -3
  45. package/src/structures/IAgenticaCallBenchmarkResult.ts +10 -4
  46. package/src/structures/IAgenticaCallBenchmarkScenario.ts +8 -2
  47. package/src/structures/IAgenticaSelectBenchmarkEvent.ts +9 -3
  48. package/src/structures/IAgenticaSelectBenchmarkResult.ts +10 -4
  49. package/src/structures/IAgenticaSelectBenchmarkScenario.ts +8 -2
  50. package/src/utils/MathUtil.ts +16 -3
@@ -1,215 +1,217 @@
1
- import { AgenticaTokenUsage } from "@agentica/core";
2
- import { ILlmSchema } from "@samchon/openapi";
1
+ /**
2
+ * @module
3
+ * This file contains functions to work with AgenticaSelectBenchmarkReporter.
4
+ *
5
+ * @author Wrtn Technologies
6
+ */
7
+ import type { AgenticaTokenUsage } from "@agentica/core";
8
+ import type { ILlmSchema } from "@samchon/openapi";
3
9
 
4
- import { IAgenticaSelectBenchmarkEvent } from "../structures/IAgenticaSelectBenchmarkEvent";
5
- import { IAgenticaSelectBenchmarkResult } from "../structures/IAgenticaSelectBenchmarkResult";
10
+ import type { IAgenticaSelectBenchmarkEvent } from "../structures/IAgenticaSelectBenchmarkEvent";
11
+ import type { IAgenticaSelectBenchmarkResult } from "../structures/IAgenticaSelectBenchmarkResult";
6
12
  import { MathUtil } from "../utils/MathUtil";
7
13
  import { AgenticaBenchmarkUtil } from "./AgenticaBenchmarkUtil";
8
14
 
9
15
  /**
10
16
  * @internal
11
17
  */
12
- export namespace AgenticaSelectBenchmarkReporter {
13
- export const markdown = <Model extends ILlmSchema.Model>(
14
- result: IAgenticaSelectBenchmarkResult<Model>,
15
- ): Record<string, string> =>
16
- Object.fromEntries([
17
- ["./README.md", writeIndex(result)],
18
- ...result.experiments
19
- .map((exp) => [
20
- [`./${exp.scenario.name}/README.md`, writeExperimentIndex(exp)],
21
- ...exp.events.map((event, i) => [
22
- `./${exp.scenario.name}/${i + 1}.${event.type}.md`,
23
- writeExperimentEvent(event, i),
24
- ]),
25
- ])
26
- .flat(),
27
- ]);
18
+ export const AgenticaSelectBenchmarkReporter = {
19
+ markdown,
20
+ };
28
21
 
29
- const writeIndex = <Model extends ILlmSchema.Model>(
30
- result: IAgenticaSelectBenchmarkResult<Model>,
31
- ): string => {
32
- const events: IAgenticaSelectBenchmarkEvent<Model>[] = result.experiments
33
- .map((r) => r.events)
34
- .flat();
35
- const average: number =
36
- events
37
- .map((e) => e.completed_at.getTime() - e.started_at.getTime())
22
+ export function markdown<Model extends ILlmSchema.Model>(result: IAgenticaSelectBenchmarkResult<Model>): Record<string, string> {
23
+ const iterator = [
24
+ ["./README.md", writeIndex(result)],
25
+ ...result.experiments
26
+ .map<[string, string][]>(exp => [
27
+ [`./${exp.scenario.name}/README.md`, writeExperimentIndex(exp)],
28
+ ...exp.events.map<[string, string]>((event, i) => [
29
+ `./${exp.scenario.name}/${i + 1}.${event.type}.md`,
30
+ writeExperimentEvent(event, i),
31
+ ]),
32
+ ])
33
+ .flat(),
34
+ ] satisfies [string, string][];
35
+
36
+ return Object.fromEntries(iterator);
37
+ }
38
+
39
+ function writeIndex<Model extends ILlmSchema.Model>(result: IAgenticaSelectBenchmarkResult<Model>): string {
40
+ const events: IAgenticaSelectBenchmarkEvent<Model>[] = result.experiments
41
+ .map(r => r.events)
42
+ .flat();
43
+ const average: number
44
+ = events
45
+ .map(e => e.completed_at.getTime() - e.started_at.getTime())
38
46
  .reduce((a, b) => a + b, 0) / events.length;
39
- const aggregate: AgenticaTokenUsage.IComponent = result.usage.aggregate;
40
- return [
41
- "# LLM Function Selection Benchmark",
42
- "## Summary",
43
- ` - Aggregation:`,
44
- ` - Scenarios: #${result.experiments.length.toLocaleString()}`,
45
- ` - Trial: ${events.length}`,
46
- ` - Success: ${events.filter((e) => e.type === "success").length}`,
47
- ` - Failure: ${events.filter((e) => e.type === "failure").length}`,
48
- ` - Average Time: ${MathUtil.round(average).toLocaleString()} ms`,
49
- ` - Token Usage`,
50
- ` - Total: ${aggregate.total.toLocaleString()}`,
51
- ` - Input`,
52
- ` - Total: ${aggregate.input.total.toLocaleString()}`,
53
- ` - Cached: ${aggregate.input.cached.toLocaleString()}`,
54
- ` - Output:`,
55
- ` - Total: ${aggregate.output.total.toLocaleString()}`,
56
- ` - Accepted Prediction: ${aggregate.output.accepted_prediction.toLocaleString()}`,
57
- ` - Reasoning: ${aggregate.output.reasoning.toLocaleString()}`,
58
- ` - Rejected Prediction: ${aggregate.output.rejected_prediction.toLocaleString()}`,
59
- "",
60
- "## Experiments",
61
- " Name | Status | Time/Avg ",
62
- ":-----|:-------|----------:",
63
- ...result.experiments.map((exp) =>
64
- [
65
- `[${exp.scenario.name}](./${exp.scenario.name}/README.md)`,
66
- (() => {
67
- const success: number = Math.floor(
68
- (exp.events.filter((e) => e.type === "success").length /
69
- exp.events.length) *
70
- 10,
71
- );
72
- return (
73
- new Array(success).fill("■").join("") +
74
- new Array(10 - success).fill("□").join("")
75
- );
76
- })(),
77
- MathUtil.round(
78
- exp.events
79
- .map(
80
- (event) =>
81
- event.completed_at.getTime() - event.started_at.getTime(),
82
- )
83
- .reduce((a, b) => a + b, 0) / exp.events.length,
84
- ).toLocaleString() + " ms",
85
- ].join(" | "),
86
- ),
87
- ].join("\n");
88
- };
47
+ const aggregate: AgenticaTokenUsage.IComponent = result.usage.aggregate;
48
+ return [
49
+ "# LLM Function Selection Benchmark",
50
+ "## Summary",
51
+ ` - Aggregation:`,
52
+ ` - Scenarios: #${result.experiments.length.toLocaleString()}`,
53
+ ` - Trial: ${events.length}`,
54
+ ` - Success: ${events.filter(e => e.type === "success").length}`,
55
+ ` - Failure: ${events.filter(e => e.type === "failure").length}`,
56
+ ` - Average Time: ${MathUtil.round(average).toLocaleString()} ms`,
57
+ ` - Token Usage`,
58
+ ` - Total: ${aggregate.total.toLocaleString()}`,
59
+ ` - Input`,
60
+ ` - Total: ${aggregate.input.total.toLocaleString()}`,
61
+ ` - Cached: ${aggregate.input.cached.toLocaleString()}`,
62
+ ` - Output:`,
63
+ ` - Total: ${aggregate.output.total.toLocaleString()}`,
64
+ ` - Accepted Prediction: ${aggregate.output.accepted_prediction.toLocaleString()}`,
65
+ ` - Reasoning: ${aggregate.output.reasoning.toLocaleString()}`,
66
+ ` - Rejected Prediction: ${aggregate.output.rejected_prediction.toLocaleString()}`,
67
+ "",
68
+ "## Experiments",
69
+ " Name | Status | Time/Avg ",
70
+ ":-----|:-------|----------:",
71
+ ...result.experiments.map(exp =>
72
+ [
73
+ `[${exp.scenario.name}](./${exp.scenario.name}/README.md)`,
74
+ (() => {
75
+ const success: number = Math.floor(
76
+ (exp.events.filter(e => e.type === "success").length
77
+ / exp.events.length)
78
+ * 10,
79
+ );
80
+ return (
81
+ Array.from({ length: success }).fill("■").join("")
82
+ + Array.from({ length: 10 - success }).fill("□").join("")
83
+ );
84
+ })(),
85
+ `${MathUtil.round(
86
+ exp.events
87
+ .map(
88
+ event =>
89
+ event.completed_at.getTime() - event.started_at.getTime(),
90
+ )
91
+ .reduce((a, b) => a + b, 0) / exp.events.length,
92
+ ).toLocaleString()} ms`,
93
+ ].join(" | "),
94
+ ),
95
+ ].join("\n");
96
+ }
89
97
 
90
- const writeExperimentIndex = <Model extends ILlmSchema.Model>(
91
- exp: IAgenticaSelectBenchmarkResult.IExperiment<Model>,
92
- ): string => {
93
- const aggregate: AgenticaTokenUsage.IComponent = exp.usage.aggregate;
94
- return [
95
- `# ${exp.scenario.name}`,
96
- "## Summary",
97
- " - Aggregation:",
98
- ` - Trial: ${exp.events.length}`,
99
- ` - Success: ${exp.events.filter((e) => e.type === "success").length}`,
100
- ` - Failure: ${exp.events.filter((e) => e.type === "failure").length}`,
101
- ` - Average Time: ${MathUtil.round(
102
- exp.events
103
- .map(
104
- (event) =>
105
- event.completed_at.getTime() - event.started_at.getTime(),
106
- )
107
- .reduce((a, b) => a + b, 0) / exp.events.length,
108
- ).toLocaleString()} ms`,
109
- ` - Token Usage`,
110
- ` - Total: ${aggregate.total.toLocaleString()}`,
111
- ` - Input`,
112
- ` - Total: ${aggregate.input.total.toLocaleString()}`,
113
- ` - Cached: ${aggregate.input.cached.toLocaleString()}`,
114
- ` - Output:`,
115
- ` - Total: ${aggregate.output.total.toLocaleString()}`,
116
- ` - Accepted Prediction: ${aggregate.output.accepted_prediction.toLocaleString()}`,
117
- ` - Reasoning: ${aggregate.output.reasoning.toLocaleString()}`,
118
- ` - Rejected Prediction: ${aggregate.output.rejected_prediction.toLocaleString()}`,
119
- "",
120
- "## Events",
121
- " No | Type | Time",
122
- "---:|:-----|----:",
123
- ...exp.events.map((e, i) =>
124
- [
125
- `[${i + 1}.](./${i + 1}.${e.type}.md)`,
126
- e.type,
127
- MathUtil.round(e.completed_at.getTime() - e.started_at.getTime()) +
128
- " ms",
129
- ].join(" | "),
130
- ),
131
- "",
132
- "## Scenario",
133
- "### User Prompt",
134
- exp.scenario.text,
135
- "",
136
- "### Expected",
137
- "```json",
138
- JSON.stringify(
139
- AgenticaBenchmarkUtil.expectedToJson(exp.scenario.expected),
140
- null,
141
- 2,
142
- ),
143
- "```",
144
- ].join("\n");
145
- };
98
+ function writeExperimentIndex<Model extends ILlmSchema.Model>(exp: IAgenticaSelectBenchmarkResult.IExperiment<Model>): string {
99
+ const aggregate: AgenticaTokenUsage.IComponent = exp.usage.aggregate;
100
+ return [
101
+ `# ${exp.scenario.name}`,
102
+ "## Summary",
103
+ " - Aggregation:",
104
+ ` - Trial: ${exp.events.length}`,
105
+ ` - Success: ${exp.events.filter(e => e.type === "success").length}`,
106
+ ` - Failure: ${exp.events.filter(e => e.type === "failure").length}`,
107
+ ` - Average Time: ${MathUtil.round(
108
+ exp.events
109
+ .map(
110
+ event =>
111
+ event.completed_at.getTime() - event.started_at.getTime(),
112
+ )
113
+ .reduce((a, b) => a + b, 0) / exp.events.length,
114
+ ).toLocaleString()} ms`,
115
+ ` - Token Usage`,
116
+ ` - Total: ${aggregate.total.toLocaleString()}`,
117
+ ` - Input`,
118
+ ` - Total: ${aggregate.input.total.toLocaleString()}`,
119
+ ` - Cached: ${aggregate.input.cached.toLocaleString()}`,
120
+ ` - Output:`,
121
+ ` - Total: ${aggregate.output.total.toLocaleString()}`,
122
+ ` - Accepted Prediction: ${aggregate.output.accepted_prediction.toLocaleString()}`,
123
+ ` - Reasoning: ${aggregate.output.reasoning.toLocaleString()}`,
124
+ ` - Rejected Prediction: ${aggregate.output.rejected_prediction.toLocaleString()}`,
125
+ "",
126
+ "## Events",
127
+ " No | Type | Time",
128
+ "---:|:-----|----:",
129
+ ...exp.events.map((e, i) =>
130
+ [
131
+ `[${i + 1}.](./${i + 1}.${e.type}.md)`,
132
+ e.type,
133
+ `${MathUtil.round(e.completed_at.getTime() - e.started_at.getTime())
134
+ } ms`,
135
+ ].join(" | "),
136
+ ),
137
+ "",
138
+ "## Scenario",
139
+ "### User Prompt",
140
+ exp.scenario.text,
141
+ "",
142
+ "### Expected",
143
+ "```json",
144
+ JSON.stringify(
145
+ AgenticaBenchmarkUtil.expectedToJson(exp.scenario.expected),
146
+ null,
147
+ 2,
148
+ ),
149
+ "```",
150
+ ].join("\n");
151
+ }
146
152
 
147
- const writeExperimentEvent = <Model extends ILlmSchema.Model>(
148
- event: IAgenticaSelectBenchmarkEvent<Model>,
149
- index: number,
150
- ): string => {
151
- return [
152
- `# ${index + 1}. ${event.type}`,
153
- `## Summary`,
154
- ` - Name: ${event.scenario.name}`,
155
- ` - Type: ${event.type}`,
156
- ` - Time: ${(event.completed_at.getTime() - event.started_at.getTime()).toLocaleString()} ms`,
157
- ...(event.type !== "error"
158
- ? [
159
- " - Token Usage",
160
- ` - Total: ${event.usage.aggregate.toLocaleString()}`,
161
- ` - Prompt`,
162
- ` - Total: ${event.usage.aggregate.input.total.toLocaleString()}`,
163
- ` - Cached: ${event.usage.aggregate.input.cached.toLocaleString()}`,
164
- ` - Completion:`,
165
- ` - Total: ${event.usage.aggregate.output.total.toLocaleString()}`,
166
- ` - Reasoning: ${event.usage.aggregate.output.reasoning.toLocaleString()}`,
167
- ` - Accepted Prediction: ${event.usage.aggregate.output.accepted_prediction.toLocaleString()}`,
168
- ` - Rejected Prediction: ${event.usage.aggregate.output.rejected_prediction.toLocaleString()}`,
169
- ]
170
- : []),
171
- "",
172
- "## Scenario",
173
- "### User Prompt",
174
- event.scenario.text,
175
- "",
176
- "### Expected",
177
- "```json",
178
- JSON.stringify(
179
- AgenticaBenchmarkUtil.expectedToJson(event.scenario.expected),
180
- null,
181
- 2,
182
- ),
183
- "```",
184
- "",
185
- ...(event.type === "success" || event.type === "failure"
186
- ? [
187
- "## Result",
188
- ...event.selected.map((s) =>
189
- [
190
- `### ${s.operation.name}`,
191
- ` - Controller: \`${s.operation.controller.name}\``,
192
- ` - Function: \`${s.operation.function.name}\``,
193
- ` - Reason: ${s.reason}`,
194
- "",
195
- ...(s.operation.function.description
196
- ? [s.operation.function.description, ""]
197
- : []),
198
- ].join("\n"),
199
- ),
200
- ]
201
- : []),
202
- ...(event.type === "error"
203
- ? [
204
- "## Error",
205
- "```json",
206
- AgenticaBenchmarkUtil.errorToJson(
207
- JSON.stringify(event.error, null, 2),
208
- ),
209
- "```",
210
- "",
211
- ]
212
- : []),
213
- ].join("\n");
214
- };
153
+ function writeExperimentEvent<Model extends ILlmSchema.Model>(event: IAgenticaSelectBenchmarkEvent<Model>, index: number): string {
154
+ return [
155
+ `# ${index + 1}. ${event.type}`,
156
+ `## Summary`,
157
+ ` - Name: ${event.scenario.name}`,
158
+ ` - Type: ${event.type}`,
159
+ ` - Time: ${(event.completed_at.getTime() - event.started_at.getTime()).toLocaleString()} ms`,
160
+ ...(event.type !== "error"
161
+ ? [
162
+ " - Token Usage",
163
+ ` - Total: ${event.usage.aggregate.toLocaleString()}`,
164
+ ` - Prompt`,
165
+ ` - Total: ${event.usage.aggregate.input.total.toLocaleString()}`,
166
+ ` - Cached: ${event.usage.aggregate.input.cached.toLocaleString()}`,
167
+ ` - Completion:`,
168
+ ` - Total: ${event.usage.aggregate.output.total.toLocaleString()}`,
169
+ ` - Reasoning: ${event.usage.aggregate.output.reasoning.toLocaleString()}`,
170
+ ` - Accepted Prediction: ${event.usage.aggregate.output.accepted_prediction.toLocaleString()}`,
171
+ ` - Rejected Prediction: ${event.usage.aggregate.output.rejected_prediction.toLocaleString()}`,
172
+ ]
173
+ : []),
174
+ "",
175
+ "## Scenario",
176
+ "### User Prompt",
177
+ event.scenario.text,
178
+ "",
179
+ "### Expected",
180
+ "```json",
181
+ JSON.stringify(
182
+ AgenticaBenchmarkUtil.expectedToJson(event.scenario.expected),
183
+ null,
184
+ 2,
185
+ ),
186
+ "```",
187
+ "",
188
+ ...(event.type === "success" || event.type === "failure"
189
+ ? [
190
+ "## Result",
191
+ ...event.selected.map(s =>
192
+ [
193
+ `### ${s.operation.name}`,
194
+ ` - Controller: \`${s.operation.controller.name}\``,
195
+ ` - Function: \`${s.operation.function.name}\``,
196
+ ` - Reason: ${s.reason}`,
197
+ "",
198
+ ...(s.operation.function.description !== undefined && s.operation.function.description !== ""
199
+ ? [s.operation.function.description, ""]
200
+ : []),
201
+ ].join("\n"),
202
+ ),
203
+ ]
204
+ : []),
205
+ ...(event.type === "error"
206
+ ? [
207
+ "## Error",
208
+ "```json",
209
+ AgenticaBenchmarkUtil.errorToJson(
210
+ JSON.stringify(event.error, null, 2),
211
+ ),
212
+ "```",
213
+ "",
214
+ ]
215
+ : []),
216
+ ].join("\n");
215
217
  }
@@ -1,5 +1,11 @@
1
- import { AgenticaOperation } from "@agentica/core";
2
- import { ILlmSchema } from "@samchon/openapi";
1
+ /**
2
+ * @module
3
+ * This file contains the implementation of the IAgenticaBenchmarkExpected class.
4
+ *
5
+ * @author Wrtn Technologies
6
+ */
7
+ import type { AgenticaOperation } from "@agentica/core";
8
+ import type { ILlmSchema } from "@samchon/openapi";
3
9
 
4
10
  /**
5
11
  * Expected operation determinant.
@@ -18,6 +24,7 @@ export type IAgenticaBenchmarkExpected<Model extends ILlmSchema.Model> =
18
24
  | IAgenticaBenchmarkExpected.IAnyOf<Model>
19
25
  | IAgenticaBenchmarkExpected.IArray<Model>
20
26
  | IAgenticaBenchmarkExpected.IStandalone<Model>;
27
+
21
28
  export namespace IAgenticaBenchmarkExpected {
22
29
  /**
23
30
  * All of them must meet the condition, but sequence is not important.
@@ -1,7 +1,13 @@
1
- import { AgenticaPrompt, AgenticaTokenUsage } from "@agentica/core";
2
- import { ILlmSchema } from "@samchon/openapi";
1
+ /**
2
+ * @module
3
+ * This file contains the implementation of the IAgenticaCallBenchmarkEvent class.
4
+ *
5
+ * @author Wrtn Technologies
6
+ */
7
+ import type { AgenticaPrompt, AgenticaTokenUsage } from "@agentica/core";
8
+ import type { ILlmSchema } from "@samchon/openapi";
3
9
 
4
- import { IAgenticaCallBenchmarkScenario } from "./IAgenticaCallBenchmarkScenario";
10
+ import type { IAgenticaCallBenchmarkScenario } from "./IAgenticaCallBenchmarkScenario";
5
11
 
6
12
  /**
7
13
  * Event of LLM function selection benchmark.
@@ -1,8 +1,14 @@
1
- import { AgenticaTokenUsage } from "@agentica/core";
2
- import { ILlmSchema } from "@samchon/openapi";
1
+ /**
2
+ * @module
3
+ * This file contains the implementation of the IAgenticaCallBenchmarkResult class.
4
+ *
5
+ * @author Wrtn Technologies
6
+ */
7
+ import type { AgenticaTokenUsage } from "@agentica/core";
8
+ import type { ILlmSchema } from "@samchon/openapi";
3
9
 
4
- import { IAgenticaCallBenchmarkEvent } from "./IAgenticaCallBenchmarkEvent";
5
- import { IAgenticaCallBenchmarkScenario } from "./IAgenticaCallBenchmarkScenario";
10
+ import type { IAgenticaCallBenchmarkEvent } from "./IAgenticaCallBenchmarkEvent";
11
+ import type { IAgenticaCallBenchmarkScenario } from "./IAgenticaCallBenchmarkScenario";
6
12
 
7
13
  /**
8
14
  * Result of the LLM function calling benchmark.
@@ -1,6 +1,12 @@
1
- import { ILlmSchema } from "@samchon/openapi";
1
+ /**
2
+ * @module
3
+ * This file contains the implementation of the IAgenticaCallBenchmarkScenario class.
4
+ *
5
+ * @author Wrtn Technologies
6
+ */
7
+ import type { ILlmSchema } from "@samchon/openapi";
2
8
 
3
- import { IAgenticaBenchmarkExpected } from "./IAgenticaBenchmarkExpected";
9
+ import type { IAgenticaBenchmarkExpected } from "./IAgenticaBenchmarkExpected";
4
10
 
5
11
  /**
6
12
  * Scenario of function calling.
@@ -1,11 +1,17 @@
1
- import {
1
+ /**
2
+ * @module
3
+ * This file contains the implementation of the IAgenticaSelectBenchmarkEvent class.
4
+ *
5
+ * @author Wrtn Technologies
6
+ */
7
+ import type {
2
8
  AgenticaOperationSelection,
3
9
  AgenticaTextPrompt,
4
10
  AgenticaTokenUsage,
5
11
  } from "@agentica/core";
6
- import { ILlmSchema } from "@samchon/openapi";
12
+ import type { ILlmSchema } from "@samchon/openapi";
7
13
 
8
- import { IAgenticaSelectBenchmarkScenario } from "./IAgenticaSelectBenchmarkScenario";
14
+ import type { IAgenticaSelectBenchmarkScenario } from "./IAgenticaSelectBenchmarkScenario";
9
15
 
10
16
  /**
11
17
  * Event of LLM function selection benchmark.
@@ -1,8 +1,14 @@
1
- import { AgenticaTokenUsage } from "@agentica/core";
2
- import { ILlmSchema } from "@samchon/openapi";
1
+ /**
2
+ * @module
3
+ * This file contains the implementation of the IAgenticaSelectBenchmarkResult class.
4
+ *
5
+ * @author Wrtn Technologies
6
+ */
7
+ import type { AgenticaTokenUsage } from "@agentica/core";
8
+ import type { ILlmSchema } from "@samchon/openapi";
3
9
 
4
- import { IAgenticaSelectBenchmarkEvent } from "./IAgenticaSelectBenchmarkEvent";
5
- import { IAgenticaSelectBenchmarkScenario } from "./IAgenticaSelectBenchmarkScenario";
10
+ import type { IAgenticaSelectBenchmarkEvent } from "./IAgenticaSelectBenchmarkEvent";
11
+ import type { IAgenticaSelectBenchmarkScenario } from "./IAgenticaSelectBenchmarkScenario";
6
12
 
7
13
  /**
8
14
  * Result of the LLM function selection benchmark.
@@ -1,6 +1,12 @@
1
- import { ILlmSchema } from "@samchon/openapi";
1
+ /**
2
+ * @module
3
+ * This file contains the implementation of the IAgenticaSelectBenchmarkScenario class.
4
+ *
5
+ * @author Wrtn Technologies
6
+ */
7
+ import type { ILlmSchema } from "@samchon/openapi";
2
8
 
3
- import { IAgenticaBenchmarkExpected } from "./IAgenticaBenchmarkExpected";
9
+ import type { IAgenticaBenchmarkExpected } from "./IAgenticaBenchmarkExpected";
4
10
 
5
11
  /**
6
12
  * Scenario of function selection.
@@ -1,3 +1,16 @@
1
- export namespace MathUtil {
2
- export const round = (value: number): number => Math.floor(value * 100) / 100;
3
- }
1
+ /**
2
+ * @module
3
+ * This file contains functions to work with MathUtil.
4
+ *
5
+ * @author Wrtn Technologies
6
+ */
7
+
8
+ export const MathUtil = {
9
+ /**
10
+ * Round a number to 2 decimal places.
11
+ *
12
+ * @param value - The number to round.
13
+ * @returns The rounded number.
14
+ */
15
+ round: (value: number): number => Math.floor(value * 100) / 100,
16
+ };