Skip to content

convert_logs_oai_sft( )

Main function to convert Inspect AI evaluation logs to OpenAI fine-tuning format.

PARAMETER DESCRIPTION
paths_to_convert

List of paths (files or directories) to convert

TYPE: List[Union[str, Path]]

target_dir

Target directory for output JSONL files

TYPE: Union[str, Path]

require_submit

Only include trajectories where submit() was called

TYPE: bool DEFAULT: False

preserve_structure

Preserve directory structure in output

TYPE: bool DEFAULT: True

cut_after_submit

Cut conversation after submit tool response

TYPE: bool DEFAULT: True

override_system_prompt

Optional system prompt to override the original

TYPE: Optional[str] DEFAULT: None

only_used_tools

Only include tools that were actually used in the conversation

TYPE: bool DEFAULT: True

RETURNS DESCRIPTION
Dict[str, Any]

Dict containing conversion statistics and results