Build Runner
Generate Python code to run a pipe with all necessary imports and example inputs.
Usage
pipelex build runner <TARGET> [OPTIONS]
Arguments:
TARGET- Either a bundle file path (.plx) or a library directory
Options:
--pipe- Pipe code to use (mandatory for library directory, mandatory for.plxwithoutmain_pipe)--output,-o- Path to save the generated Python file (defaults to target's directory)
Examples
Generate runner from a bundle (uses main_pipe):
pipelex build runner my_bundle.plx
Specify which pipe to use from a bundle:
pipelex build runner my_bundle.plx --pipe my_pipe
Generate runner from a library directory (--pipe is mandatory):
pipelex build runner ./my_library/ --pipe my_pipe
Custom output path:
pipelex build runner my_bundle.plx --output custom_runner.py
What Gets Generated
The generated Python file includes:
- All necessary imports - Imports for Pipelex execution, content types, and any custom structures
- Generated Pydantic structures - Models for your concepts (also generated separately)
- Input memory setup - Example input values based on the pipe's input types
- Pipeline execution - Async function that executes the pipeline
- Output handling - Code to extract and display the results
- Main execution block - Pipelex initialization and asyncio setup
Input Type Handling
- Native concepts (Text, Image, PDF, etc.) - Automatically generates appropriate content objects
- Custom concepts - Recursively generates the structure with example values
- Structured content - Creates example data matching the concept's fields
Using the Generated Runner
After generating the runner file:
- Open the generated Python file
- Review and customize the example input values
- Run the script:
python results/run_{pipe_code}.py - Iterate and adjust as needed
Related Documentation
- Build Pipe - Generate pipelines from natural language
- Build Structures - Generate Pydantic models separately
- Run Command - Run pipes directly from CLI