Cookbook / Decorators
Turn typed Python functions into controlled AI calls
Use function_calling for one extraction step and workflow when tools must gather evidence first.Choose the decorator
- @function_calling: one SchemaNode maps natural language to a Pydantic parameter model; no tools.
- @workflow: allowlisted ReasoningSteps gather evidence before a final SchemaStep predicts parameters.
GitHub
Function calling source
Read the typed one-step extraction recipe.
GitHubWorkflow decorator source
Read the evidence-first typed function recipe.
Runbash
python cookbook/decorators/function_calling_example.py
python cookbook/decorators/workflow_reasoning_example.py