solvers.exports

export_chat

Export chat history in one or more formats to an export folder.

This solver extracts the chat history from the task state and saves it to an export folder in JSON and/or YAML format. Files will be exported to {export_path}/{eval_id}/{sample_id}/{output_folder}. The eval_id segment is read from state.metadata["eval_id"], falling back to eval (with a warning) if it is not set.

For full data integrity, use the JSON format. The YAML format may strip some spaces to ensure that the export is more readable (specifically, the YAML format can’t represent values with trailing spaces using the block scaler style).

@solver
def export_chat(
    export_path: str = "exports",
    output_folder: str = "chat",
    include_json: bool = True,
    include_yaml: bool = True,
) -> Solver
export_path str

Base export path (default: “exports”)

output_folder str

Folder name within the export path (default: “chat”)

include_json bool

Whether to save chat as JSON file (default: True)

include_yaml bool

Whether to save chat as YAML file with multiline support (default: True)

Returns

Solver that exports chat history to the host

export_sample_files

Export sample reference files to an export folder.

This solver copies the sample’s reference files to an export folder for analysis and debugging. Files will be exported to {export_path}/{eval_id}/{sample_id}/{output_folder}. The eval_id segment is read from state.metadata["eval_id"], falling back to eval (with a warning) if it is not set.

@solver
def export_sample_files(
    export_path: str = "exports",
    output_folder: str = "sample",
    files_key: str = "files",
) -> Solver
export_path str

Base export path (default: “exports”)

output_folder str

Folder name within the export path (default: “sample”)

files_key str

Key in state.metadata containing the files map (default: “files”)

Returns

Solver that exports sample files to an export folder

export_sandbox_files

Export files from the sandbox to the host machine.

This solver copies the current state of files from the sandbox to the host machine for analysis and debugging. Files will be exported to {export_path}/{eval_id}/{sample_id}/{output_folder}. The eval_id segment is read from state.metadata["eval_id"], falling back to eval (with a warning) if it is not set.

@solver
def export_sandbox_files(
    sandbox_location: RepoLocation | Sequence[RepoLocation] = "/workspace",
    export_path: str = "exports",
    output_folder: str = "files",
    exclude: Sequence[str] = DEFAULT_EXCLUDE,
) -> Solver
sandbox_location RepoLocation | Sequence[RepoLocation]

Location of the folder in the sandbox to export (default: “/workspace”). Defaults to a sandbox source if no source is specified.

export_path str

Base export path (default: “exports”)

output_folder str

Folder name within the export path (default: “files”)

exclude Sequence[str]

List of patterns to exclude when copying files

Returns

Solver that exports sandbox files to the host

export_store

Export store data to an export folder.

This solver extracts the store data from the task state and saves it to an export folder in the specified format. Files will be exported to {export_path}/{eval_id}/{sample_id}/{output_folder}. The eval_id segment is read from state.metadata["eval_id"], falling back to eval (with a warning) if it is not set.

@solver
def export_store(
    export_path: str = "exports",
    output_folder: str = "store",
    format: str = "yaml",
    include_keys: Sequence[str] | None = None,
    exclude_keys: Sequence[str] | None = None,
) -> Solver
export_path str

Base export path (default: “exports”)

output_folder str

Folder name within the export path (default: “store”)

format str

Export format - “json” or “yaml” (default: “yaml”)

include_keys Sequence[str] | None

Sequence of store keys to include (if None, includes all available keys)

exclude_keys Sequence[str] | None

Sequence of store keys to exclude (default: None)

Returns

Solver that exports store data to an export folder