dlgforge.pipeline.runner¶
Main generation and judge orchestration flows.
run(config_path)
¶
Run synthetic conversation generation from a config file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config_path
|
str
|
Path to a configuration file. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
None |
None
|
No value is returned. |
Raises:
| Type | Description |
|---|---|
FileNotFoundError
|
Raised when validation or runtime requirements are not met. |
Side Effects / I/O: - May perform network, model, or distributed runtime operations.
Preconditions / Invariants: - Callers should provide arguments matching annotated types and expected data contracts.
Examples:
>>> from dlgforge.pipeline.runner import run
>>> run(...)
run_judge_only(config_path)
¶
Run judge evaluation on existing conversation artifacts.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config_path
|
str
|
Path to a configuration file. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
None |
None
|
No value is returned. |
Raises:
| Type | Description |
|---|---|
FileNotFoundError
|
Raised when validation or runtime requirements are not met. |
RuntimeError
|
Raised when validation or runtime requirements are not met. |
Side Effects / I/O: - May perform network, model, or distributed runtime operations.
Preconditions / Invariants: - Callers should provide arguments matching annotated types and expected data contracts.
Examples:
>>> from dlgforge.pipeline.runner import run_judge_only
>>> run_judge_only(...)
run_multi_turn(cfg, output_paths, base_inputs, min_turns, max_turns, turn_count_distribution, turn_count_mean)
¶
Run multi turn.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cfg
|
Dict[str, Any]
|
Configuration mapping that controls runtime behavior. |
required |
output_paths
|
OutputPaths
|
Filesystem path used by this operation. |
required |
base_inputs
|
Dict[str, Any]
|
Mapping payload for this operation. |
required |
min_turns
|
int
|
int value used by this operation. |
required |
max_turns
|
int
|
int value used by this operation. |
required |
turn_count_distribution
|
str
|
str value used by this operation. |
required |
turn_count_mean
|
float
|
float value used by this operation. |
required |
Returns:
| Type | Description |
|---|---|
Tuple[List[Dict[str, Any]], List[Dict[str, Any]], Dict[str, Any]]
|
Tuple[List[Dict[str, Any]], List[Dict[str, Any]], Dict[str, Any]]: Value produced by this API. |
Raises:
| Type | Description |
|---|---|
Exception
|
Propagates unexpected runtime errors from downstream calls. |
Side Effects / I/O: - May perform network, model, or distributed runtime operations.
Preconditions / Invariants: - Callers should provide arguments matching annotated types and expected data contracts.
Examples:
>>> from dlgforge.pipeline.runner import run_multi_turn
>>> run_multi_turn(...)
run_multi_turn_batched_async(cfg, output_paths, base_inputs, max_turns, batch_size, min_turns=1, turn_count_distribution='poisson', turn_count_mean=0.0, conversation_inputs_by_index=None)
async
¶
Run multi turn batched async.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cfg
|
Dict[str, Any]
|
Configuration mapping that controls runtime behavior. |
required |
output_paths
|
OutputPaths
|
Filesystem path used by this operation. |
required |
base_inputs
|
Dict[str, Any]
|
Mapping payload for this operation. |
required |
max_turns
|
int
|
int value used by this operation. |
required |
batch_size
|
int
|
Numeric control value for processing behavior. |
required |
min_turns
|
int
|
int value used by this operation. |
1
|
turn_count_distribution
|
str
|
str value used by this operation. |
'poisson'
|
turn_count_mean
|
float
|
float value used by this operation. |
0.0
|
conversation_inputs_by_index
|
List[Dict[str, Any]] | None
|
List[Dict[str, Any]] | None value used by this operation. |
None
|
Returns:
| Type | Description |
|---|---|
Tuple[Dict[str, Any], List[Dict[str, Any]]]
|
Tuple[Dict[str, Any], List[Dict[str, Any]]]: Value produced by this API. |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
Raised when validation or runtime requirements are not met. |
Side Effects / I/O: - May perform network, model, or distributed runtime operations.
Preconditions / Invariants: - Callers should provide arguments matching annotated types and expected data contracts.
Examples:
>>> from dlgforge.pipeline.runner import run_multi_turn_batched_async
>>> run_multi_turn_batched_async(...)
persist_training_sample(output_paths, inputs, result, turns, raw_results)
¶
Persist training sample.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
output_paths
|
OutputPaths
|
Filesystem path used by this operation. |
required |
inputs
|
Dict[str, Any]
|
Mapping payload for this operation. |
required |
result
|
Any
|
Input value for this operation. |
required |
turns
|
List[Dict[str, Any]]
|
Conversation or message data used during processing. |
required |
raw_results
|
List[Dict[str, Any]]
|
Conversation or message data used during processing. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
None |
None
|
No value is returned. |
Raises:
| Type | Description |
|---|---|
Exception
|
Propagates unexpected runtime errors from downstream calls. |
Side Effects / I/O: - May perform network, model, or distributed runtime operations.
Preconditions / Invariants: - Callers should provide arguments matching annotated types and expected data contracts.
Examples:
>>> from dlgforge.pipeline.runner import persist_training_sample
>>> persist_training_sample(...)
persist_batched_training_samples(output_paths, base_inputs, conversations)
¶
Persist batched training samples.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
output_paths
|
OutputPaths
|
Filesystem path used by this operation. |
required |
base_inputs
|
Dict[str, Any]
|
Mapping payload for this operation. |
required |
conversations
|
List[Dict[str, Any]]
|
List[Dict[str, Any]] value used by this operation. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
int |
int
|
Value produced by this API. |
Raises:
| Type | Description |
|---|---|
Exception
|
Propagates unexpected runtime errors from downstream calls. |
Side Effects / I/O: - May perform network, model, or distributed runtime operations.
Preconditions / Invariants: - Callers should provide arguments matching annotated types and expected data contracts.
Examples:
>>> from dlgforge.pipeline.runner import persist_batched_training_samples
>>> persist_batched_training_samples(...)