Worker protocol
You only need this page if you're adding support for a new language. If you just want to write evals, head to Cases and runners.
The short version
eac starts a worker process for your language and talks to it with JSON, one message per line:
- Requests come in on fd 3 and responses go out on fd 4, so stdout and stderr stay free for logs.
- The worker's first line says which protocol it speaks, and optionally its SDK's language and version, so eac can tell users when it's out of date:
{"protocol": 1, "sdk": {"language": "Python", "version": "0.0.1"}}. - eac sends one request at a time and waits for the answer.
- When eac closes fd 3, the worker should exit.
{"id": 1, "method": "case.run", "params": {}}
{"id": 1, "result": {"run_results": {}}}Methods
| Method | What it does |
|---|---|
discover | Load a dataset and list its cases. |
args.validate | Report the credentials a run needs, before anything runs. |
seed.setup | Set up a fixture. |
seed.teardown | Clean up a fixture. |
case.run | Run one case. |
case.judge | Score one case's output. |
online.execute | Collect production runs as cases. |
online.judge | Score one collected case. |
credentials.check | Report which credentials are ready. |
credentials.login | Log in to a credential. |
The full spec, with every param and result, is in core/PROTOCOL.md.