Skip to content

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 .plx without main_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:

  1. All necessary imports - Imports for Pipelex execution, content types, and any custom structures
  2. Generated Pydantic structures - Models for your concepts (also generated separately)
  3. Input memory setup - Example input values based on the pipe's input types
  4. Pipeline execution - Async function that executes the pipeline
  5. Output handling - Code to extract and display the results
  6. 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:

  1. Open the generated Python file
  2. Review and customize the example input values
  3. Run the script: python results/run_{pipe_code}.py
  4. Iterate and adjust as needed