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.containspasses when every expected row is produced, whatever else is. - Values. They are compared by meaning rather than spelling:
2,"2"and2.0are equal, and so areTrue,"true"and Vadalog’s#T. Expected CSVs have no header unless you passheader=True. - Inputs.
paramsandcomputeare passed to the evaluation as inevaluate_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:
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:- Create a new notebook with kernel Python and run the following commands in a dedicated cell
-
Clone the repo
-
Navigate into the project and install it
-
Copy the project into site-packages to allow importing and using it
- Restart the kernel
-
Uninstall the project
-
Clone the repo if it is not present
else update it to the latest changes
-
Navigate into the project and install it
-
Remove an existing installation if present
-
Copy the project into site-packages to allow importing and using it
- Restart the kernel
Response Format
All REST API responses follow a consistent format: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.done event, or an error event if
something goes wrong mid-stream.
API Categories
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

