-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathevaluator.ts
More file actions
30 lines (28 loc) · 789 Bytes
/
evaluator.ts
File metadata and controls
30 lines (28 loc) · 789 Bytes
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
// TODO: Point the imports to acp-node after publishing
import AcpClient, {
AcpContractClient,
AcpJobPhases,
AcpJob,
baseSepoliaAcpConfig
} from '@virtuals-protocol/acp-node';
import {
EVALUATOR_AGENT_WALLET_ADDRESS,
EVALUATOR_ENTITY_ID,
EVALUATOR_WALLET_PRIVATE_KEY,
} from "./env";
async function evaluator() {
new AcpClient({
acpContractClient: await AcpContractClient.build(
EVALUATOR_WALLET_PRIVATE_KEY,
EVALUATOR_ENTITY_ID,
EVALUATOR_AGENT_WALLET_ADDRESS,
baseSepoliaAcpConfig
),
onEvaluate: async (job: AcpJob) => {
console.log("Evaluation function called", job);
await job.evaluate(true, "Externally evaluated and approved");
console.log(`Job ${job.id} evaluated`);
},
});
}
evaluator();