Skip to content

export

diapason.evals.core.export

Export functions for agentic run traces and profiling records.

export_artifacts_manifest(run_dir)

Scan {run_dir}/artifacts/ and write artifacts_manifest.json.

The manifest lists every per-query artifact directory together with the files it contains, making it easy for downstream tools to discover what was produced without walking the directory tree themselves.

Returns:

Type Description
Optional[Path]

The manifest path, or None if there is no artifacts directory.

export_hf_dataset(traces, path)

Export traces as a HuggingFace Arrow dataset.

Parameters:

Name Type Description Default
traces list[QueryTrace]

List of QueryTrace objects to export.

required
path Path

Output directory for the Arrow dataset.

required

Returns:

Type Description
Path

The path to the saved dataset directory.

Raises:

Type Description
ImportError

If the datasets package is not installed.

export_jsonl(traces, path)

Export traces as JSONL (one JSON object per line).

Parameters:

Name Type Description Default
traces list[QueryTrace]

List of QueryTrace objects to export.

required
path Path

Output file path. Parent directories are created if needed.

required

Returns:

Type Description
Path

The path to the written file.

export_summary_json(traces, config, path, *, bench_energy=None)

Export aggregate summary as JSON.

Parameters:

Name Type Description Default
traces list[QueryTrace]

List of QueryTrace objects.

required
config dict[str, Any]

Run configuration dictionary.

required
path Path

Output file path.

required
bench_energy Optional[dict[str, Any]]

Optional benchmark-level aggregate telemetry dict.

None

Returns:

Type Description
Path

The path to the written file.