Skip to content

Latest commit

 

History

History

tutorial

README.md

Tutorial Examples

This directory contains Python script versions of the tutorial notebooks, suitable for running directly or studying the code.

Examples

File Description
example.py General introduction to Mellea with basic examples.
simple_email.py Email generation example - the classic "Hello World" of Mellea.
instruct_validate_repair.py Walkthrough of the instruct-validate-repair paradigm.
compositionality_with_generative_stubs.py Tutorial on composing generative functions.
context_example.py Working with contexts and context management.
document_mobject.py Using document MObjects for text processing.
table_mobject.py Working with table data structures.
model_options_example.py Configuring model options and parameters.
sentiment_classifier.py Building a sentiment classification system.

Learning Path

Recommended order for learning Mellea:

  1. simple_email.py - Start here for basic concepts
  2. instruct_validate_repair.py - Core paradigm
  3. compositionality_with_generative_stubs.py - Building blocks
  4. context_example.py - Context management
  5. model_options_example.py - Configuration
  6. sentiment_classifier.py - Complete application
  7. document_mobject.py - Working with documents
  8. table_mobject.py - Working with structured data

Converting to Notebooks

To convert a script to a notebook:

# Install jupytext
uv pip install jupytext

# Convert
jupytext --to notebook docs/examples/tutorial/simple_email.py

See Also