evoproc_procedures.builders¶
High-level builders for creating + validating procedures (backend-agnostic).
Functions
Create a procedure for task and repair it until valid. |
- evoproc_procedures.builders.create_and_validate_procedure_structured(idx, task, *, model, query_fn, seed=1234, print_diagnostics=False)[source]¶
Create a procedure for task and repair it until valid.
- Steps:
Build a creation prompt (create_procedure_prompt(task)).
Ask for a structured Procedure object using query_fn with the Pydantic schema.
Parse the JSON and run repair_procedure_structured(…).
- Parameters:
idx (
int) – Index/id for logging.task (
str) – Natural-language task description.model (
str) – LLM model name.query_fn (
Callable[[str,str,Optional[Dict[str,Any]],Optional[int]],str]) – Backend function to call the LLM.seed (
Optional[int]) – Random seed for the backend (if supported).print_diagnostics (
bool) – If True, print repair diagnostics.
- Return type:
- Returns:
A structurally valid procedure JSON.
- Raises:
ValueError – If the model response is not valid JSON.