Examples demonstrating the @generative decorator for creating type-safe, composable LLM functions.
| File | Description |
|---|---|
generative_stubs.py |
Basic sentiment classification and text summarization with @generative functions and Literal return types. |
generate_with_context.py |
Generative stubs with dynamic context and role modification. |
generative_gsm8k.py |
Stepwise chain-of-thought mathematical reasoning on GSM8K problems using structured Pydantic models. |
generative_stubs_with_requirements.py |
Enforcing preconditions and postcondition requirements on generative stub executions. |
investment_advice.py |
Multi-step financial advice workflow with semantic preconditions and compliance checks. |
inter_module_composition/ |
Modular generative pipeline composing summarization and decision-making modules. |