-
Notifications
You must be signed in to change notification settings - Fork 1
/
view.mjs
54 lines (48 loc) · 1.3 KB
/
view.mjs
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// Usage: node ./view.mjs
import "dotenv/config";
import { inspect } from "util";
import { setupOracle } from "./common/index.mjs";
async function main() {
const oracle = await setupOracle();
// task id from command line
const taskId = BigInt(process.argv[2] ?? 1);
console.log("Viewing task:", taskId);
console.log("\nGenerations:");
const responses = await oracle.getResponses(taskId);
for (const responseRaw of responses) {
const response = await oracle.processResponse(responseRaw);
console.log(
inspect(response, {
showHidden: false,
depth: null,
colors: true,
})
);
}
console.log("\nValidations:");
const validations = await oracle.getValidations(taskId);
if (!validations.length) {
console.log("No validations made.");
} else {
for (const validationRaw of validations) {
const validation = await oracle.processValidation(validationRaw);
console.log(
inspect(validation, {
showHidden: true,
depth: null,
colors: true,
})
);
}
}
console.log("\nBest Response:");
const bestResponse = await oracle.getBestResponse(taskId);
console.log(
inspect(bestResponse, {
showHidden: true,
depth: null,
colors: true,
})
);
}
main().catch(console.error);