No install needed beyond agentx-python itself. Use PrecomputedAdapter when you already have your agent’s outputs (from a batch job, a low-code tool like n8n, or a previous run) and just want them scored, without invoking a live callable or HTTP endpoint.
Usage
PrecomputedAdapter(outputs)
outputs is either:
- A
dict keyed by case_id (the format shown above): "case-{questionIndex}" for a dataset’s Nth question, e.g. "case-0", "case-1". This is the recommended form.
- A plain
list, positionally matched to question index: outputs[0] is the answer for question 0, and so on. Internally this is just sugar for {"0": outputs[0], "1": outputs[1], ...}.
Each value is either the output text directly (a str), or a dict for full control, using the same shape as any other adapter’s return value: output/text, plus optional metadata, input_tokens, output_tokens, trace_id. Every case in the dataset must have a matching key, or it’s submitted with an empty response.
case_id doesn’t vary by repetition. If the dataset’s config runs each question more than once (number_of_requests > 1), every repetition of a question looks up the same key and gets the same precomputed output submitted for all of them. PrecomputedAdapter is built for the common case of one precomputed answer per question; if you have distinct precomputed outputs per repetition, submit results directly via the REST results endpoint instead (POST /custom-agent-evaluations/runs/:id/results), setting a distinct runNumber and idempotencyKey per call.
A complete working example is available as precomputed_results_eval.py in the AgentX-Python repository, or csv_import_eval.py for loading the dataset itself from a CSV file first (see Build Dataset).