-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathagentLoopBenchmark
More file actions
executable file
·35 lines (27 loc) · 1.55 KB
/
Copy pathagentLoopBenchmark
File metadata and controls
executable file
·35 lines (27 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/java --enable-native-access=ALL-UNNAMED -Dtools.permissions.default=allow --class-path=../zsmith/zbo/zsmith.jar:../zsmith/zbo/lightmetal.jar --source 25
import airhacks.zsmith.agent.boundary.Agent;
import airhacks.zsmith.benchmark.boundary.PointerChasingBenchmark;
import airhacks.zsmith.tools.control.WriteClipboardTool;
import airhacks.zsmith.tui.control.CommandLine;
void main(String... args) {
var depth = CommandLine.firstInt(args, 50);
var benchmark = new PointerChasingBenchmark(depth);
// The walk needs one agent turn per hop (the hops are serially dependent, so at most one
// tool call resolves per turn) plus one turn to emit the answer: depth + 1 at minimum.
// The extra slack absorbs stray turns — a "thinking" turn with no tool call, or a retry
// after an unknown-key error — so an occasional wasted turn does not trip a false FAIL.
var maxIterations = depth + 20;
var agent = new Agent("pointer-chaser", benchmark.systemPrompt())
.withTool(benchmark.tool())
.withMaxIterations(maxIterations);
var result = benchmark.score(agent.chat("go"));
// one normalized markdown row on stdout and in the clipboard — ready to paste into the
// summary table in README.md; failure details go to stderr so they never end up in the table
var row = result.markdownRow(agent.modelName());
IO.println(row);
System.err.println(WriteClipboardTool.write(row));
var diagnostics = result.diagnostics();
if (!diagnostics.isEmpty()) {
System.err.println(diagnostics);
}
}