The prometheux_chain Python SDK provides a high-level interface for working with all Prometheux platform features programmatically.

Installation

Configuration

First API Call

Unit-test a Vadalog program

check_program evaluates a program on the engine and compares each output predicate with the rows you expect, given as a CSV file or as a list of rows. It never raises for a failed check or an engine error: read report.ok and report.summary(), or call report.assert_ok(), which raises AssertionError with the summary. That makes it fit directly in a pytest suite:
  • Modes. exact (the default) passes when the predicate produces the same rows, the same number of times. contains passes when every expected row is produced, whatever else is.
  • Values. They are compared by meaning rather than spelling: 2, "2" and 2.0 are equal, and so are True, "true" and Vadalog’s #T. Expected CSVs have no header unless you pass header=True.
  • Inputs. params and compute are passed to the evaluation as in evaluate_program.
check_question does the same for a program the natural-language translator writes from a question. The generated program is kept on the report, so a failure shows what was run:
When expect is a single CSV or list of rows, it is checked against expect_predicate, or the generated program’s last @output when that is not given. Each call counts as one program generation in your usage.
Both functions evaluate on your compute, so a machine must be running. The px test command runs the same checks from files, and writes a JUnit report for CI.

Install into Jupyter

To manually install the library in your Jupyter Lab or Jupyter Notebook follow these steps:
  1. Create a new notebook with kernel Python and run the following commands in a dedicated cell
  2. Clone the repo
  3. Navigate into the project and install it
  4. Copy the project into site-packages to allow importing and using it
  5. Restart the kernel
To update an existing installation of Prometheux Chain follow these steps:
  1. Uninstall the project
  2. Clone the repo if it is not present
    else update it to the latest changes
  3. Navigate into the project and install it
  4. Remove an existing installation if present
  5. Copy the project into site-packages to allow importing and using it
  6. Restart the kernel

Response Format

All REST API responses follow a consistent format:
The Python SDK automatically handles responses and returns the relevant data directly.

Streaming responses

Some endpoints stream their output incrementally — the AI Agent chat, Context Layer auto-seed, and the concept run-stream. In the SDK these are exposed as generator functions: iterate over them to consume events as they arrive instead of waiting for the whole response.
Each yielded event mirrors the NDJSON frames documented on the corresponding API Reference page. Streams terminate with a done event, or an error event if something goes wrong mid-stream.

API Categories

For a flat index of every px.<function> mapped to its endpoint, see the SDK Function Reference.
The API is organized into the following categories:

Error Handling

The SDK raises exceptions for errors:

Requirements

  • Python 3.9 or higher
  • Install via pip: pip install prometheux-chain