> ## Documentation Index
> Fetch the complete documentation index at: https://developers.agentx.so/llms.txt
> Use this file to discover all available pages before exploring further.

# Submit Pre-Defined Results

> Score outputs you already generated, without re-running the agent

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

```python theme={null}
from agentx import AgentX
from agentx.evaluations.adapters.precomputed import PrecomputedAdapter

client = AgentX.from_env()

outputs = {
    "case-0": "To reset your password, go to Login → Forgot Password.",
    "case-1": {
        "output": "We accept Visa, Mastercard, PayPal, and bank transfers.",
        "metadata": {"source": "n8n-export", "model": "gpt-4o"},
    },
}

adapter = PrecomputedAdapter(outputs)

run_context = (
    client.evaluations
    .run(dataset_id="...", subject={"kind": "custom_agent", "displayName": "n8n Batch", "framework": "n8n", "runtime": "low_code"})
    .execute(adapter)
    .finalize()
)
print(f"Average rating: {run_context.average_rating:.2f}")
```

### `PrecomputedAdapter(outputs)`

```python theme={null}
PrecomputedAdapter(outputs: list[Any] | dict[str, Any])
```

`outputs` is either:

* **A `dict` keyed by `case_id`** (the format shown above): `"case-{questionIndex}"` for a dataset's `N`th 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.

<Note>
  `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.
</Note>

A complete working example is available as [`precomputed_results_eval.py`](https://github.com/AgentX-ai/AgentX-Python/blob/main/examples/evaluations/precomputed_results_eval.py) in the AgentX-Python repository, or [`csv_import_eval.py`](https://github.com/AgentX-ai/AgentX-Python/blob/main/examples/evaluations/csv_import_eval.py) for loading the dataset itself from a CSV file first (see [Build Dataset](/sdk/evaluations/build-dataset#csv-import)).
