evoproc_procedures.models

Typed models for procedure creation and execution.

These Pydantic models define the structure of a global-state procedure:
  • Each Step can read variables produced by previous steps.

  • Step 1 consumes only problem_text.

  • The final step emits final_answer (a description, not a computed value).

The models use snake_case Python attribute names but expose camelCase aliases at the JSON boundary so you can interoperate with existing data.

Example

>>> from .models import Procedure, Step, StepInputField, StepOutputField
>>> proc = Procedure(
...     name_description="Add two numbers",
...     steps=[
...         Step(
...             id=1,
...             inputs=[StepInputField(name="problem_text", description="Task text")],
...             step_description="Extract numbers a and b from the text.",
...             outputs=[StepOutputField(name="a", description="First number"),
...                      StepOutputField(name="b", description="Second number")],
...         ),
...     ],
... )
>>> proc.model_dump(by_alias=True)["nameDescription"]
'Add two numbers'

Classes

Procedure

A full global-state procedure composed of ordered steps.

Step

One atomic instruction within a global-state procedure.

StepInputField

A named input consumed by a step.

StepOutputField

A variable produced by a step.

class evoproc_procedures.models.StepInputField[source]

Bases: BaseModel

A named input consumed by a step.

Variables:
  • name – Variable name expected by the step (e.g., "problem_text").

  • description – Human-readable description of what this input represents.

name: str = Ellipsis
description: str = Ellipsis
class evoproc_procedures.models.StepOutputField[source]

Bases: BaseModel

A variable produced by a step.

Variables:
  • name – Variable name produced by the step (snake_case recommended).

  • description – Human-readable description of the output variable.

name: str = Ellipsis
description: str = Ellipsis
class evoproc_procedures.models.Step[source]

Bases: BaseModel

One atomic instruction within a global-state procedure.

Notes

  • Steps should be single-action and declarative.

  • Use prior outputs as inputs by variable name.

  • Keep variable names stable and snake_case.

Variables:
  • id – 1-based step identifier (contiguous in execution order).

  • inputs – List of required input variables for this step.

  • step_description – Natural-language instruction describing exactly what the step does.

  • outputs – List of variables produced by this step.

id: int = Ellipsis
step_description: str = Ellipsis
class evoproc_procedures.models.Procedure[source]

Bases: BaseModel

A full global-state procedure composed of ordered steps.

Variables:
  • name_description – Short summary of the procedure’s purpose (task or capability).

  • steps – Ordered list of steps. Step 1 should consume only problem_text; the final step should produce final_answer.

name_description: str = Ellipsis
steps: List[Step] = Ellipsis