helper-asks.ts 277 B

1234567891011121314
  1. interface Answer {
  2. value: number;
  3. }
  4. const solver = agent("solver");
  5. async function solve(question: string): Promise<number> {
  6. const a = await solver.ask<Answer>(question);
  7. return a.value;
  8. }
  9. const x = await solve("2 + 2");
  10. const y = await solve("3 + 3");
  11. return x + y;