synkro.generate()
Generate training traces from a policy document.| Parameter | Type | Default | Description |
|---|---|---|---|
policy | str | Policy | required | Policy text or Policy object |
traces | int | 20 | Number of traces to generate |
turns | int | str | "auto" | Conversation turns. "auto" for policy complexity-driven |
dataset_type | DatasetType | CONVERSATION | Type of dataset |
generation_model | str | "gpt-5-mini" | Model for generating responses |
grading_model | str | "gpt-5.2" | Model for grading (use stronger model) |
max_iterations | int | 3 | Max refinement iterations per trace |
skip_grading | bool | False | Skip grading phase for faster generation |
reporter | ProgressReporter | None | Progress reporter (default: RichReporter) |
return_logic_map | bool | False | Return GenerationResult with Logic Map |
enable_hitl | bool | True | Enable Human-in-the-Loop editing |
base_url | str | None | API base URL for local LLM providers |
temperature | float | 0.7 | Sampling temperature (0.0-2.0) |
synkro.generate_scenarios()
Generate eval scenarios without synthetic responses.| Parameter | Type | Default | Description |
|---|---|---|---|
policy | str | Policy | required | Policy text or Policy object |
count | int | 100 | Number of scenarios to generate |
generation_model | str | "gpt-4o-mini" | Model for generation |
temperature | float | 0.8 | Sampling temperature |
reporter | ProgressReporter | None | Progress reporter |
enable_hitl | bool | False | Enable Human-in-the-Loop editing |
base_url | str | None | API base URL |
synkro.grade()
Grade a response against a scenario and policy.| Parameter | Type | Default | Description |
|---|---|---|---|
response | str | required | Model response to grade |
scenario | EvalScenario | required | Eval scenario with expected outcome |
policy | str | Policy | required | Policy for grading context |
model | str | "gpt-4o" | LLM for grading |
base_url | str | None | API base URL |
synkro.create_pipeline()
Create a customized generation pipeline.| Parameter | Type | Default | Description |
|---|---|---|---|
model | str | "gpt-4o-mini" | Model for generating responses |
grading_model | str | "gpt-4o" | Model for grading |
dataset_type | DatasetType | CONVERSATION | Type of dataset |
max_iterations | int | 3 | Max refinement iterations |
skip_grading | bool | False | Skip grading phase |
reporter | ProgressReporter | None | Progress reporter |
tools | list[ToolDefinition] | None | Tool definitions for TOOL_CALL |
checkpoint_dir | str | None | Directory for checkpointing |
enable_hitl | bool | True | Enable Human-in-the-Loop |
base_url | str | None | API base URL |
temperature | float | 0.7 | Sampling temperature |
thinking | bool | False | Enable <think> tags |
Dataset.save()
Save dataset to a JSONL file.| Parameter | Type | Default | Description |
|---|---|---|---|
path | str | Path | None | Output path (auto-generated if None) |
format | str | "messages" | Output format |
pretty_print | bool | False | Format with indentation |
"messages", "qa", "langsmith", "langfuse", "tool_call", "chatml", "bert", "bert:<task>"
Dataset.filter()
Filter traces by criteria.| Parameter | Type | Default | Description |
|---|---|---|---|
passed | bool | None | Filter by grade status |
category | str | None | Filter by category |
min_length | int | None | Minimum response length |
Dataset.dedupe()
Remove duplicates.| Parameter | Type | Default | Description |
|---|---|---|---|
threshold | float | 0.85 | Similarity threshold (0-1) |
method | str | "semantic" | Method: "exact" or "semantic" |
field | str | "user" | Field: "user", "assistant", or "both" |
Dataset.push_to_hub()
Push to HuggingFace Hub.| Parameter | Type | Default | Description |
|---|---|---|---|
repo_id | str | required | HuggingFace repo ID |
format | str | "messages" | Output format |
private | bool | False | Private repo |
split | str | "train" | Dataset split |
token | str | None | HuggingFace token |
ToolDefinition
Define a tool for TOOL_CALL datasets.| Parameter | Type | Default | Description |
|---|---|---|---|
name | str | required | Tool name |
description | str | required | Tool description |
parameters | dict | {} | JSON Schema for parameters |
examples | list[dict] | [] | Example tool calls |
mock_responses | list[str] | [] | Mock responses for simulation |
FileLoggingReporter
Log to file with optional console output.| Parameter | Type | Default | Description |
|---|---|---|---|
delegate | ProgressReporter | RichReporter() | Reporter for display |
log_dir | str | "." | Log directory |
log_filename | str | None | Custom filename (auto if None) |