Index
recipes
¶
Recipe system — composable primitive configurations.
Classes¶
Recipe
dataclass
¶
Recipe(
name: str,
description: str = "",
version: str = "0.1.0",
kind: str = "discrete",
model: Optional[str] = None,
quantization: Optional[str] = None,
provider: Optional[str] = None,
engine_key: Optional[str] = None,
agent_type: Optional[str] = None,
max_turns: Optional[int] = None,
temperature: Optional[float] = None,
max_tokens: Optional[int] = None,
tools: List[str] = list(),
system_prompt: Optional[str] = None,
system_prompt_path: Optional[str] = None,
routing_policy: Optional[str] = None,
agent_policy: Optional[str] = None,
eval_suites: List[str] = list(),
eval_benchmarks: List[str] = list(),
eval_backend: Optional[str] = None,
eval_max_samples: Optional[int] = None,
eval_judge_model: Optional[str] = None,
schedule_type: Optional[str] = None,
schedule_value: Optional[str] = None,
channels: List[str] = list(),
required_capabilities: List[str] = list(),
raw: Dict[str, Any] = dict(),
)
A composable primitive configuration loaded from TOML.
Covers both discrete agents (benchmarking / one-shot) and operator
agents (persistent / scheduled) through the kind field.
Methods:¶
to_builder_kwargs
¶
Convert recipe fields to kwargs for SystemBuilder/Diapason.
Returns a dict with only the non-None fields, keyed to match the SystemBuilder fluent API or Diapason constructor parameters.
Source code in src/diapason/recipes/loader.py
to_eval_suite
¶
to_eval_suite(
benchmarks: Optional[List[str]] = None,
max_samples: Optional[int] = None,
judge_model: Optional[str] = None,
) -> Any
Convert this recipe into an EvalSuiteConfig.
Uses the recipe's model/engine as the single [[models]] entry
and the recipe's benchmarks (or benchmarks override) as
[[benchmarks]], inheriting agent type and tools.
Source code in src/diapason/recipes/loader.py
to_operator_manifest
¶
Functions:¶
recipe_to_eval_suite
¶
recipe_to_eval_suite(
recipe: Recipe,
benchmarks: Optional[List[str]] = None,
max_samples: Optional[int] = None,
judge_model: Optional[str] = None,
) -> EvalSuiteConfig
Build an EvalSuiteConfig from a recipe.
The recipe's model / engine become the single [[models]] entry.
The recipe's eval_benchmarks (or the benchmarks override) become
[[benchmarks]] entries. Agent type and tools are inherited so the
eval runner constructs the right backend automatically.
Args:
recipe: Source recipe.
benchmarks: Override benchmark list (defaults to recipe.eval_benchmarks).
max_samples: Override per-benchmark sample cap.
judge_model: Override LLM judge model.
Raises: ValueError: If no model or benchmarks can be resolved.
Source code in src/diapason/recipes/composer.py
recipe_to_operator
¶
recipe_to_operator(recipe: Recipe) -> OperatorManifest
Build an OperatorManifest from a recipe.
Maps the recipe's agent, schedule, and channel fields into the
operator manifest format used by OperatorManager.
Raises: ValueError: If schedule information is missing.
Source code in src/diapason/recipes/composer.py
discover_recipes
¶
discover_recipes(
extra_dirs: Optional[List[str | Path]] = None,
*,
kind: Optional[str] = None,
) -> List[Recipe]
Discover all TOML recipes from known directories.
Search order (later entries override earlier ones by name):
1. Project recipes/data/ directory (discrete recipes)
2. Project recipes/data/operators/ directory (operator recipes)
3. User ~/.diapason/recipes/ directory
4. User ~/.diapason/operators/ directory
5. Any additional directories in extra_dirs
Args: extra_dirs: Additional directories to scan. kind: If set, filter to only "discrete" or "operator" recipes.
Source code in src/diapason/recipes/loader.py
load_recipe
¶
load_recipe(path: str | Path) -> Recipe
Load a recipe from a TOML file.
Supports the unified format with [recipe], [intelligence],
[engine], [agent], [learning], [eval], [schedule],
and [channels] sections. Also auto-detects legacy operator manifests
that use [operator] as the top-level key.
Raises: FileNotFoundError: If path does not exist.