EnvironmentSingleTurn subclass.
Import these public names in environment code:
EnvironmentSingleTurn:
environment.py
input/output row shape (Task
records). load_task_examples(...) exposes each
record’s input/output as example.input/example.output, with the raw row
available as example.record.
For SFT, the SDK builds the training conversation from the environment’s
start_episode(example, prompt_text) plus sft_completion(example). The default
sft_completion converts example.output into completion messages. See
Datasets for the scalar and
message-shaped output forms. Override sft_completion only when the gold
completion must be synthesized from other fields.
Single-turn environments usually implement build_prompt_messages. The SDK’s
default start_episode calls it and prepends the run’s prompt text as a
system message when your messages lack one, so local eval, SFT, and GRPO see
the same policy prompt. Multi-turn environments own start_episode; put any
task-specific initial system message there. On managed runs, Flash applies the
same guarantee to every episode’s opening messages, single- and multi-turn: if
start_episode returns no system message (or an empty one), the run’s prompt
text becomes the system message.
When a run uses thinking = true, score_response receives answer text by
default. response_text stays string-compatible and also exposes
response_text.completion, response_text.thinking, and response_text.raw for
rewards that inspect the reasoning trace.
Pass parameters
If yourload_environment(**kwargs) accepts arguments, set them under
[environment.params]:
Next steps
Multi-turn environments
Handle conversations, tools, and agents.
Datasets
Row shapes and SFT target formats.