Skip to content

Build AI methods with your coding agent, then run them anywhere: as an MCP for chatbots, as a webapp for people, or via API for your software.

Refactor/toml-to-plx (#249)

Thomas Hebrarddce552d85858
diff --git a/.cursor/rules/llms.mdc b/.cursor/rules/llms.mdc
index e83f70edf..f8a11cc97 100644
--- a/.cursor/rules/llms.mdc
+++ b/.cursor/rules/llms.mdc
@@ -36,7 +36,7 @@ And of course, llm_handles are automatically assigned for all models by their na
Here is an example of using an llm_handle to specify which LLM to use in a PipeLLM:
-```toml
+```plx
[pipe.hello_world]
type = "PipeLLM"
description = "Write text about Hello World."
@@ -61,7 +61,7 @@ llm_to_extract_invoice = { llm_handle = "claude-3-7-sonnet", temperature = 0.1,
The interest is that these presets can be used to set the LLM choice in a PipeLLM, like this:
-```toml
+```plx
[pipe.extract_invoice]
type = "PipeLLM"
description = "Extract invoice information from an invoice text transcript"
diff --git a/.cursor/rules/pipe-batch.mdc b/.cursor/rules/pipe-batch.mdc
index 6a2d94687..729c31c0f 100644
--- a/.cursor/rules/pipe-batch.mdc
+++ b/.cursor/rules/pipe-batch.mdc
@@ -7,9 +7,9 @@ alwaysApply: false
The PipeBatch controller allows you to apply a pipe operation to each element in a list of inputs in parallele. It is created via a PipeSequence.
-## Usage in TOML Configuration
+## Usage in PLX Configuration
-```toml
+```plx
[pipe.sequence_with_batch]
type = "Sequence"
description = "A Sequence of pipes"
diff --git a/.cursor/rules/pipe-condition.mdc b/.cursor/rules/pipe-condition.mdc
index 17eea9d8f..bfae8ac98 100644
--- a/.cursor/rules/pipe-condition.mdc
+++ b/.cursor/rules/pipe-condition.mdc
@@ -7,11 +7,11 @@ alwaysApply: false
The PipeCondition controller allows you to implement conditional logic in your pipeline, choosing which pipe to execute based on an evaluated expression. It supports both direct expressions and expression templates.
-## Usage in TOML Configuration
+## Usage in PLX Configuration
### Basic Usage with Direct Expression
-```toml
+```plx
[pipe.conditional_operation]
type = "PipeCondition"
description = "A conditonal pipe to decide wheter..."
@@ -25,7 +25,7 @@ medium = "process_medium"
large = "process_large"
```
or
-```toml
+```plx
[pipe.conditional_operation]
type = "PipeCondition"
description = "A conditonal pipe to decide wheter..."
diff --git a/.cursor/rules/pipe-llm.mdc b/.cursor/rules/pipe-llm.mdc
index 03ebb1904..cb6bf7cad 100644
--- a/.cursor/rules/pipe-llm.mdc
+++ b/.cursor/rules/pipe-llm.mdc
@@ -14,7 +14,7 @@ PipeLLM is used to:
## Basic Usage
### Simple Text Generation
-```toml
+```plx
[pipe.write_story]
type = "PipeLLM"
description = "Write a short story"
@@ -25,7 +25,7 @@ Write a short story about a programmer.
```
### Structured Data Extraction
-```toml
+```plx
[pipe.extract_info]
type = "PipeLLM"
description = "Extract information"
@@ -56,7 +56,7 @@ class PersonInfo(StructuredContent): # The output models always have to be subcl
You can specify LLM settings in two ways:
1. **Direct in the pipe**:
-```toml
+```plx
[pipe.analyze]
type = "PipeLLM"
description = "Analyze text"
@@ -66,7 +66,7 @@ prompt_template = "Analyze this text"
```
2. **Using predefined settings** from `pipelex_libraries/llm_deck/base_llm_deck.toml`:
-```toml
+```plx
[pipe.analyze]
type = "PipeLLM"
description = "Analyze text"
@@ -77,7 +77,7 @@ prompt_template = "Analyze this text"
### System Prompts
Add system-level instructions:
-```toml
+```plx
[pipe.expert_analysis]
type = "PipeLLM"
description = "Expert analysis"
@@ -88,7 +88,7 @@ prompt_template = "Analyze this data"
### Multiple Outputs
Generate multiple results:
-```toml
+```plx
[pipe.generate_ideas]
type = "PipeLLM"
description = "Generate ideas"
@@ -100,7 +100,7 @@ multiple_output = true # Let the LLM decide how many to generate
### Vision Tasks
Process images with VLMs:
-```toml
+```plx
[pipe.analyze_image]
type = "PipeLLM"
description = "Analyze image"
diff --git a/.cursor/rules/pipe-ocr.mdc b/.cursor/rules/pipe-ocr.mdc
index 053162a9e..1e21281aa 100644
--- a/.cursor/rules/pipe-ocr.mdc
+++ b/.cursor/rules/pipe-ocr.mdc
@@ -12,7 +12,7 @@ Extract text and images from an image or a PDF
## Basic Usage
### Simple Text Generation
-```toml
+```plx
[pipe.extract_info]
type = "PipeOcr"
description = "extract the information"
diff --git a/.cursor/rules/pipe-sequence.mdc b/.cursor/rules/pipe-sequence.mdc
index cf47ced93..d1ab1786d 100644
--- a/.cursor/rules/pipe-sequence.mdc
+++ b/.cursor/rules/pipe-sequence.mdc
@@ -9,7 +9,7 @@ alwaysApply: false
PipeSequence executes multiple pipes in a defined order, where each step can use results from previous steps.
## Basic Structure
-```toml
+```plx
[pipe.your_sequence_name]
type = "PipeSequence"
description = "Description of what this sequence does"
@@ -38,7 +38,7 @@ steps = [
You can use PipeBatch functionality within steps using `batch_over` and `batch_as`:
-```toml
+```plx
steps = [
{ pipe = "process_items", batch_over = "input_list", batch_as = "current_item", result = "processed_items"
}
diff --git a/.cursor/rules/pipelex.mdc b/.cursor/rules/pipelex.mdc
index 1402e1eba..3f578db37 100644
--- a/.cursor/rules/pipelex.mdc
+++ b/.cursor/rules/pipelex.mdc
@@ -10,7 +10,7 @@ alwaysApply: true
# Pipeline Structure Guide
## Pipeline File Naming
-- Files must be `.toml` for pipelines (Always add an empty line at the end of the file, and do not add trailing whitespaces to TOML files at all)
+- Files must be `.plx` for pipelines (Always add an empty line at the end of the file, and do not add trailing whitespaces to PLX files at all)
- Files must be `.py` for structures
- Use descriptive names in `snake_case`
@@ -21,14 +21,14 @@ A pipeline file has three main sections:
3. Pipe definitions
### Domain Statement
-```toml
+```plx
domain = "domain_name"
definition = "Description of the domain" # Optional
```
-Note: The domain name usually matches the toml filename for single-file domains. For multi-file domains, use the subdirectory name.
+Note: The domain name usually matches the plx filename for single-file domains. For multi-file domains, use the subdirectory name.
### Concept Definitions
-```toml
+```plx
[concept]
ConceptName = "Description of the concept" # Should be the same name as the Structure ClassName you want to output
```
@@ -43,7 +43,7 @@ yes
## Pipe Base Structure
-```toml
+```plx
[pipe.your_pipe_name]
type = "PipeLLM"
description = "A description of what your pipe does"
@@ -52,14 +52,14 @@ output = "ConceptName"
```
DO NOT WRITE:
-```toml
+```plx
[pipe.your_pipe_name]
type = "pipe_sequence"
```
But it should be:
-```toml
+```plx
[pipe.your_pipe_name]
type = "PipeSequence"
description = "....."
@@ -74,7 +74,7 @@ That means that the pipe validate_expense is missing the input `ocr_input` becau
NEVER WRITE THE INPUTS BY BREAKING THE LINE LIKE THIS:
<NEVER DO THIS>
-```toml
+```plx
inputs = {
input_1 = "ConceptName1",
input_2 = "ConceptName2"
@@ -152,7 +152,7 @@ Look at the Pipes we have in order to adapt it. Pipes are organized in two categ
PipeSequence executes multiple pipes in a defined order, where each step can use results from previous steps.
## Basic Structure
-```toml
+```plx
[pipe.your_sequence_name]
type = "PipeSequence"
description = "Description of what this sequence does"
@@ -175,7 +175,7 @@ steps = [
You can use PipeBatch functionality within steps using `batch_over` and `batch_as`:
-```toml
+```plx
steps = [
{ pipe = "process_items", batch_over = "input_list", batch_as = "current_item", result = "processed_items"
}
@@ -196,11 +196,11 @@ The result of a batched step will be a `ListContent` containing the outputs from
The PipeCondition controller allows you to implement conditional logic in your pipeline, choosing which pipe to execute based on an evaluated expression. It supports both direct expressions and expression templates.
-## Usage in TOML Configuration
+## Usage in PLX Configuration
### Basic Usage with Direct Expression
-```toml
+```plx
[pipe.conditional_operation]
type = "PipeCondition"
description = "A conditonal pipe to decide wheter..."
@@ -214,7 +214,7 @@ medium = "process_medium"
large = "process_large"
```
or
-```toml
+```plx
[pipe.conditional_operation]
type = "PipeCondition"
description = "A conditonal pipe to decide wheter..."
@@ -240,9 +240,9 @@ large = "process_large"
The PipeBatch controller allows you to apply a pipe operation to each element in a list of inputs in parallele. It is created via a PipeSequence.
-## Usage in TOML Configuration
+## Usage in PLX Configuration
-```toml
+```plx
[pipe.sequence_with_batch]
type = "PipeSequence"
description = "A Sequence of pipes"
@@ -271,7 +271,7 @@ PipeLLM is used to:
## Basic Usage
### Simple Text Generation
-```toml
+```plx
[pipe.write_story]
type = "PipeLLM"
description = "Write a short story"
@@ -282,7 +282,7 @@ Write a short story about a programmer.
```
### Structured Data Extraction
-```toml
+```plx
[pipe.extract_info]
type = "PipeLLM"
description = "Extract information"
@@ -296,7 +296,7 @@ Extract person information from this text:
### System Prompts
Add system-level instructions:
-```toml
+```plx
[pipe.expert_analysis]
type = "PipeLLM"
description = "Expert analysis"
@@ -307,7 +307,7 @@ prompt_template = "Analyze this data"
### Multiple Outputs
Generate multiple results:
-```toml
+```plx
[pipe.generate_ideas]
type = "PipeLLM"
description = "Generate ideas"
@@ -319,7 +319,7 @@ multiple_output = true # Let the LLM decide how many to generate
### Vision Tasks
Process images with VLMs:
-```toml
+```plx
[pipe.analyze_image]
type = "PipeLLM"
description = "Analyze image"
@@ -337,7 +337,7 @@ Extract text and images from an image or a PDF
## Basic Usage
### Simple Text Generation
-```toml
+```plx
[pipe.extract_info]
type = "PipeOcr"
description = "extract the information"
@@ -369,7 +369,7 @@ This rule explains how to write prompt templates in PipeLLM definitions.
If the inserted text is supposedly long text, made of several lines or paragraphs, you want it inserted inside a block, possibly a block tagged and delimlited with proper syntax as one would do in a markdown documentation. To include stuff as a block, use the "@" prefix.
Example template:
-```toml
+```plx
prompt_template = """
Match the expense with its corresponding invoice:
@@ -388,7 +388,7 @@ In this example, the expense data and the invoices data are obviously made of se
If the inserted text is short text and it makes sense to have it inserted directly into a sentence, you want it inserted inline. To insert stuff inline, use the "$" prefix. This will insert the stuff without delimiters and the content will be rendered as plain text.
Example template:
-```toml
+```plx
prompt_template = """
Your goal is to summarize everything related to $topic in the provided text:
diff --git a/.cursor/rules/pipes.mdc b/.cursor/rules/pipes.mdc
index 8ff2e482f..e7b81982f 100644
--- a/.cursor/rules/pipes.mdc
+++ b/.cursor/rules/pipes.mdc
@@ -11,7 +11,7 @@ alwaysApply: false
# Pipeline Structure Guide
## Pipeline File Naming
-- Files must be `.toml` for pipelines
+- Files must be `.plx` for pipelines
- Files must be `.py` for structures
- Use descriptive names in `snake_case`
@@ -22,14 +22,14 @@ A pipeline file has three main sections:
3. Pipe definitions
### Domain Statement
-```toml
+```plx
domain = "domain_name"
definition = "Description of the domain" # Optional
```
-Note: The domain name usually matches the toml filename for single-file domains. For multi-file domains, use the subdirectory name.
+Note: The domain name usually matches the plx filename for single-file domains. For multi-file domains, use the subdirectory name.
### Concept Definitions
-```toml
+```plx
[concept]
ConceptName = "Description of the concept" # Should be the same name as the Structure ClassName you want to output
```
@@ -44,7 +44,7 @@ Important Rules:
## Pipe Base Structure
-```toml
+```plx
[pipe.your_pipe_name]
type = "PipeLLM"
description = "A description of what your pipe does"
diff --git a/.cursor/rules/prompt-templates.mdc b/.cursor/rules/prompt-templates.mdc
index 9fa7238f9..a3ab438e4 100644
--- a/.cursor/rules/prompt-templates.mdc
+++ b/.cursor/rules/prompt-templates.mdc
@@ -1,6 +1,6 @@
---
description:
-globs: pipelex/libraries/pipelines/**/*.toml
+globs: pipelex/libraries/pipelines/**/*.plx
alwaysApply: false
---
This rule explains how to write prompt templates in PipeLLM definitions.
@@ -10,7 +10,7 @@ This rule explains how to write prompt templates in PipeLLM definitions.
If the inserted text is supposedly long text, made of several lines or paragraphs, you want it inserted inside a block, possibly a block tagged and delimlited with proper syntax as one would do in a markdown documentation. To include stuff as a block, use the "@" prefix.
Example template:
-```toml
+```plx
prompt_template = """
Match the expense with its corresponding invoice:
@@ -29,7 +29,7 @@ In this example, the expense data and the invoices data are obviously made of se
If you want to conditionally insert a block only when the variable exists and is not empty, use the "@?" prefix. This is useful for optional fields that may or may not be present in your data.
Example template:
-```toml
+```plx
prompt_template = """
User Profile:
@@ -52,7 +52,7 @@ In this example, the bio and contact_info will only be inserted if they exist. I
If the inserted text is short text and it makes sense to have it inserted directly into a sentence, you want it inserted inline. To insert stuff inline, use the "$" prefix. This will insert the stuff without delimiters and the content will be rendered as plain text.
Example template:
-```toml
+```plx
prompt_template = """
Your goal is to summarize everything related to $topic in the provided text:
diff --git a/.cursor/rules/pytest.mdc b/.cursor/rules/pytest.mdc
index 09994dd3b..e93a05c70 100644
--- a/.cursor/rules/pytest.mdc
+++ b/.cursor/rules/pytest.mdc
@@ -14,7 +14,7 @@ These rules apply when writing unit tests.
- `tests/unit/` - for unit tests that test individual functions/classes in isolation
- `tests/integration/` - for integration tests that test component interactions
- `tests/e2e/` - for end-to-end tests that test complete workflows
- - `tests/test_pipelines/` - for test pipeline definitions (TOML files and their structuring python files)
+ - `tests/test_pipelines/` - for test pipeline definitions (PLX files and their structuring python files)
- Fixtures are defined in conftest.py modules at different levels of the hierarchy, their scope is handled by pytest
- Test data is placed inside test_data.py at different levels of the hierarchy, they must be imported with package paths from the root like `tests.pipelex.test_data`. Their content is all constants, regrouped inside classes to keep things tidy.
- Always put test inside Test classes.
diff --git a/.github/assets/sample_code.png b/.github/assets/sample_code.png
new file mode 100644
index 000000000..978007d1d
Binary files /dev/null and b/.github/assets/sample_code.png differ
diff --git a/.pipelex/create/draft_pipelines.md b/.pipelex/create/draft_pipelines.md
index 3217d4255..c1cabf032 100644
--- a/.pipelex/create/draft_pipelines.md
+++ b/.pipelex/create/draft_pipelines.md
@@ -252,7 +252,7 @@ Before finalizing your draft:
## From Draft to Implementation
Once your markdown draft is complete, it can be translated into:
-1. A formal TOML pipeline definition with explicit pipe declarations
+1. A formal PLX pipeline definition with explicit pipe declarations
2. Python structure classes for complex data types (when needed)
3. Validated, executable Pipelex pipeline code
diff --git a/.pipelex/create/structures.md b/.pipelex/create/structures.md
index bd7df9127..fe785a954 100644
--- a/.pipelex/create/structures.md
+++ b/.pipelex/create/structures.md
@@ -31,13 +31,13 @@ Ask yourself:
### Step 2: Design Schema Definitions
-Create a TOML file defining your structures using the syntax from `structured_output_generator.py`.
+Create a PLX file defining your structures using the syntax from `structured_output_generator.py`.
## Structure Definition Syntax
### Basic Structure Definition
-```toml
+```plx
[structure.ModelName]
definition = "Clear description of what this represents"
@@ -59,7 +59,7 @@ another_field = { type = "text", definition = "More detailed field", required =
### Field Configuration Options
-```toml
+```plx
# Required field (must be provided)
title = { type = "text", definition = "Document title", required = true }
@@ -74,7 +74,7 @@ categories = { type = "list", item_type = "text", definition = "Document categor
### Simple Enum (List of Values)
-```toml
+```plx
[enum.Priority]
definition = "Task priority levels"
values = ["low", "medium", "high", "urgent"]
@@ -82,7 +82,7 @@ values = ["low", "medium", "high", "urgent"]
### Descriptive Enum (Key-Value Pairs)
-```toml
+```plx
[enum.DocumentType]
definition = "Types of documents we can process"
@@ -95,7 +95,7 @@ marketing = "Marketing materials and content"
### Using Enums in Structures
-```toml
+```plx
# Reference defined enum
status = { type = "Priority", definition = "Current priority level" }
@@ -119,9 +119,9 @@ LLM[classify]: (document_content) → document_metadata
LLM[analyze]: (page_info_list, document_metadata) → final_analysis
```
-**Structure Definition (document_analysis_structures.toml):**
+**Structure Definition (document_analysis_structures.plx):**
-```toml
+```plx
# Enums for constrained values
[enum.DocumentType]
definition = "Types of documents we can process"
@@ -264,7 +264,7 @@ After defining structures, update your pipeline blueprint concepts to reference
**Use string reference when:**
- Structure is reusable across multiple concepts or pipelines
-- Structure is complex and benefits from being defined in a separate TOML file
+- Structure is complex and benefits from being defined in a separate PLX file
- You want to maintain separation between concept definitions and structure details
**Use inline definition when:**
@@ -279,13 +279,13 @@ After defining structures, update your pipeline blueprint concepts to reference
### Generating Python Classes
-**From TOML files:**
+**From PLX files:**
```python
-from pipelex.create.structured_output_generator import generate_structured_outputs_from_toml_file
+from pipelex.create.structured_output_generator import generate_structured_outputs_from_plx_file
-# Generate Python classes from TOML definitions
-generate_structured_outputs_from_toml_file(
- "document_analysis_structures.toml",
+# Generate Python classes from PLX definitions
+generate_structured_outputs_from_plx_file(
+ "document_analysis_structures.plx",
"document_analysis.py"
)
```
@@ -354,7 +354,7 @@ Before finalizing your structure definitions:
## Common Patterns
### Contact Information
-```toml
+```plx
[structure.ContactInfo]
definition = "Contact information extracted from document"
@@ -367,7 +367,7 @@ address = "Physical address"
```
### Analysis Results
-```toml
+```plx
[enum.Sentiment]
definition = "Sentiment analysis results"
values = ["positive", "negative", "neutral"]
@@ -383,7 +383,7 @@ word_count = { type = "integer", definition = "Total word count" }
```
### Classification Results
-```toml
+```plx
[structure.Classification]
definition = "Multi-class classification result"
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9775d39aa..d42f89c13 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,14 @@
# Changelog
-## Unreleased
+## [v0.9.0] - 2025-09-02
+
+### Refacto
+
+- Changed the pipeline file extension from `.toml` to `.plx`: Updated the LibraryManager in consequence.
+
+## Fixed
+
+- Fixed the structuring_method behavior in the `PipeLLM` pipe.
### Changed
diff --git a/CLAUDE.md b/CLAUDE.md
index e1348a788..9da6c7969 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -29,7 +29,7 @@ This python >=3.10 code is in the `pipelex` directory.
- `tests/unit/` - for unit tests that test individual functions/classes in isolation
- `tests/integration/` - for integration tests that test component interactions
- `tests/e2e/` - for end-to-end tests that test complete workflows
- - `tests/test_pipelines/` - for test pipeline definitions (TOML files and their structuring python files)
+ - `tests/test_pipelines/` - for test pipeline definitions (PLX files and their structuring python files)
- Fixtures are defined in conftest.py modules at different levels of the hierarchy, their scope is handled by pytest
- Test data is placed inside test_data.py at different levels of the hierarchy, they must be imported with package paths from the root like `tests.pipelex.test_data`. Their content is all constants, regrouped inside classes to keep things tidy.
- Always put test inside Test classes.
diff --git a/README.md b/README.md
index 7dedd80f4..14803d455 100644
--- a/README.md
+++ b/README.md
@@ -63,10 +63,10 @@ Pipelex makes it easy for developers to define and run repeatable AI workflows.
Build **pipelines** from modular pipes that snap together. Each pipe can use a different language model (LLM) or software to process knowledge. Pipes consistently deliver **structured, predictable outputs** at each stage.
-Pipelex uses TOML syntax, making workflows readable and shareable. Business professionals, developers, and AI coding agents can all understand and modify the same pipeline definitions.
+Pipelex uses its own syntax PLX, based on TOML, making workflows readable and shareable. Business professionals, developers, and AI coding agents can all understand and modify the same pipeline definitions.
Example:
-```toml
+```plx
[concept]
Buyer = "The person who made the purchase"
PurchaseDocumentText = "Transcript of a receipt, invoice, or order confirmation"
@@ -100,6 +100,8 @@ Follow these steps to get started:
- Python ≥3.10
- [pip](https://pip.pypa.io/en/stable/), [poetry](https://python-poetry.org/), or [uv](https://github.com/astral-sh/uv) package manager
+We **highly** recommend installing our own extension for PLX files into your IDE of choice. You can find it in the [Open VSX Registry](https://open-vsx.org/extension/Pipelex/pipelex). It's coming soon to VS Code marketplace too and if you are using Cursor, Windsurf or another VS Code fork, you can search for it directly in your extensions tab.
+
### Option #1: Run examples
Visit the
@@ -118,17 +120,13 @@ poetry add pipelex
uv pip install pipelex
```
-## IDE extension
-
-We **highly** recommend installing an extension for TOML files into your IDE of choice. For VS Code, the [Even Better TOML](https://marketplace.visualstudio.com/items?itemName=tamasfe.even-better-toml) extension does a great job of syntax coloring and checking.
-
### Optional Features
The package supports the following additional features:
-- `anthropic`: Anthropic/Claude support
+- `anthropic`: Anthropic/Claude support+
- `google`: Google models (Vertex) support
-- `mistralai`: Mistral AI support
+- `mistralai`: Mistral AI support√
- `bedrock`: AWS Bedrock support
- `fal`: Image generation with Black Forest Labs "FAL" service
@@ -153,9 +151,17 @@ uv pip install "pipelex[anthropic,google,mistralai,bedrock,fal]"
## Example: optimizing a tweet in 2 steps
-### 1. Define the pipeline in TOML
+Example with the extension you can download now on Cursor, Windsurf or another VS Code fork. (Coming soon for VS Code Marketplace)
-```toml
+<div>
+<a href="https://open-vsx.org/extension/Pipelex/pipelex">
+<img src="https://raw.githubusercontent.com/Pipelex/pipelex/main/.github/assets/sample_code.png" alt="Pipelex Code Sample" style="max-width: 100%; height: auto;">
+</a>
+</div>
+
+### 1. Define the pipeline in PLX
+
+```plx
domain = "tech_tweet"
definition = "A pipeline for optimizing tech tweets using Twitter/X best practices"
@@ -189,10 +195,10 @@ Evaluate the tweet for these key issues:
For each criterion, provide:
1. A score (1-5) where 1 = not present, 5 = severely present
-2. If the problem is not present, no comment. Otherwise, explain of the issue and give concise guidance on fixing it, without providing an actual rewrite
+2. If the problem is not present, no comment. Otherwise, explain of the issue and give concise guidance on fixing it,
+without providing an actual rewrite
@draft_tweet
-
"""
[pipe.optimize_tweet]
diff --git a/docs/pages/build-reliable-ai-workflows-with-pipelex/adapt-to-llm-prompting-style-openai-anthropic-mistral.md b/docs/pages/build-reliable-ai-workflows-with-pipelex/adapt-to-llm-prompting-style-openai-anthropic-mistral.md
index 2d17890c5..2abdb1665 100644
--- a/docs/pages/build-reliable-ai-workflows-with-pipelex/adapt-to-llm-prompting-style-openai-anthropic-mistral.md
+++ b/docs/pages/build-reliable-ai-workflows-with-pipelex/adapt-to-llm-prompting-style-openai-anthropic-mistral.md
@@ -21,7 +21,7 @@ Each prompting style defines how prompts are formatted and presented to the LLM.
## Example Configuration
-```toml
+```plx
[pipelex.prompting_config]
default_prompting_style = "chat"
diff --git a/docs/pages/build-reliable-ai-workflows-with-pipelex/configure-ai-llm-to-optimize-workflows.md b/docs/pages/build-reliable-ai-workflows-with-pipelex/configure-ai-llm-to-optimize-workflows.md
index b8736ef83..0ccc8f508 100644
--- a/docs/pages/build-reliable-ai-workflows-with-pipelex/configure-ai-llm-to-optimize-workflows.md
+++ b/docs/pages/build-reliable-ai-workflows-with-pipelex/configure-ai-llm-to-optimize-workflows.md
@@ -62,7 +62,7 @@ llm_to_extract = {
Here's how to use these configurations in your pipelines:
-```toml
+```plx
[pipe.generate_response]
type = "PipeLLM"
description = "Generate a creative response"
diff --git a/docs/pages/build-reliable-ai-workflows-with-pipelex/define_your_concepts.md b/docs/pages/build-reliable-ai-workflows-with-pipelex/define_your_concepts.md
index 4a92d6184..212b84431 100644
--- a/docs/pages/build-reliable-ai-workflows-with-pipelex/define_your_concepts.md
+++ b/docs/pages/build-reliable-ai-workflows-with-pipelex/define_your_concepts.md
@@ -10,7 +10,7 @@ Every concept starts with a natural language definition. This definition serves
The simplest way to define a concept is with a descriptive sentence:
-```toml
+```plx
[concept]
Invoice = "A commercial document issued by a seller to a buyer"
Employee = "A person employed by an organization"
@@ -22,7 +22,7 @@ Those concepts will be Text-based by default. If you want to use sutrctured outp
**Key principles for concept definitions:**
1. **Define what it is, not what it's for**
- ```toml
+ ```plx
# ❌ Wrong: includes usage context
TextToSummarize = "Text that needs to be summarized"
@@ -31,7 +31,7 @@ Those concepts will be Text-based by default. If you want to use sutrctured outp
```
2. **Use singular forms**
- ```toml
+ ```plx
# ❌ Wrong: plural form
Invoices = "Commercial documents from sellers"
@@ -40,7 +40,7 @@ Those concepts will be Text-based by default. If you want to use sutrctured outp
```
3. **Avoid unnecessary adjectives**
- ```toml
+ ```plx
# ❌ Wrong: includes subjective qualifier
LongArticle = "A lengthy written composition"
@@ -52,8 +52,8 @@ Those concepts will be Text-based by default. If you want to use sutrctured outp
Group concepts that naturally belong together in the same domain. A domain acts as a namespace for a set of related concepts and pipes, helping you organize and reuse your pipeline components. You can learn more about them in [Kick off a Knowledge Pipeline Project](kick-off-a-knowledge-pipeline-project.md#what-are-domains).
-```toml
-# pipelex_libraries/pipelines/finance.toml
+```plx
+# pipelex_libraries/pipelines/finance.plx
domain = "finance"
description = "Financial document processing"
@@ -145,10 +145,10 @@ class Meeting(StructuredContent):
### Linking Concepts to Models
-The connection between TOML definitions and Python models happens automatically through naming:
+The connection between PLX definitions and Python models happens automatically through naming:
-```toml
-# pipelex_libraries/pipelines/hr.toml
+```plx
+# pipelex_libraries/pipelines/hr.plx
domain = "hr"
[concept]
@@ -195,7 +195,7 @@ Sometimes concepts build on each other. A `Contract` is a kind of `Document`. A
Use the `refines` field to indicate when one concept is a more specific version of another:
-```toml
+```plx
[concept]
Document = "A written or printed record"
@@ -218,7 +218,7 @@ Concept refinement helps in two ways:
For example, a pipe that processes `Document` can also process `Contract` or `EmploymentContract`:
-```toml
+```plx
[pipe.extract_key_points]
type = "PipeLLM"
description = "Extract main points from any document"
@@ -305,7 +305,7 @@ class DynamicContent(StuffContent):
Native concepts can be used directly in your pipeline definitions without any additional setup:
-```toml
+```plx
[pipe.analyze_document]
type = "PipeLLM"
description = "Analyze a PDF document"
@@ -332,7 +332,7 @@ prompt_template = "Extract key information from this page content"
You can create more specific concepts by refining native ones:
-```toml
+```plx
[concept.Invoice]
definition = "A commercial document issued by a seller to a buyer"
refines = "PDF"
diff --git a/docs/pages/build-reliable-ai-workflows-with-pipelex/design_and_run_pipelines.md b/docs/pages/build-reliable-ai-workflows-with-pipelex/design_and_run_pipelines.md
index 5fcaeace2..1d2523434 100644
--- a/docs/pages/build-reliable-ai-workflows-with-pipelex/design_and_run_pipelines.md
+++ b/docs/pages/build-reliable-ai-workflows-with-pipelex/design_and_run_pipelines.md
@@ -11,9 +11,9 @@ A pipeline is composed of pipes. There are two fundamental types of pipes you wi
* **[Pipe Operators](pipe-operators/index.md)**: These are the "workers" of your pipeline. They perform concrete actions like calling an LLM (`PipeLLM`), extracting text from a document (`PipeOcr`), or running a Python function (`PipeFunc`). Each operator is a specialized tool designed for a specific task.
* **[Pipe Controllers](pipe-controllers/index.md)**: These are the "managers" of your pipeline. They don't perform tasks themselves but orchestrate the execution flow of other pipes. They define the logic of your workflow, such as running pipes in sequence (`PipeSequence`), in parallel (`PipeParallel`), or based on a condition (`PipeCondition`).
-## Designing a Pipeline: Composition in TOML
+## Designing a Pipeline: Composition in PLX
-The most common way to design a pipeline is by defining and composing pipes in a `.toml` configuration file. This provides a clear, declarative way to see the structure of your workflow.
+The most common way to design a pipeline is by defining and composing pipes in a `.plx` configuration file. This provides a clear, declarative way to see the structure of your workflow.
Each pipe, whether it's an operator or a controller, is defined in its own `[pipe.<pipe_name>]` table. The `<pipe_name>` becomes the unique identifier for that pipe.
@@ -23,8 +23,8 @@ Let's look at a simple example. Imagine we want a workflow that:
We can achieve this with a `PipeLLM` operator.
-```toml
-# Filename: marketing_pipeline.toml
+```plx
+# Filename: marketing_pipeline.plx
domain = "marketing"
definition = "Marketing content generation domain"
@@ -57,8 +57,8 @@ The inputs specified will be required before the pipe is executed. Those inputs
The output concept is very important. Indeed, the output of your pipe wille be corresponding to the concept you specify. If the concept is structured, the output will be a structured object. If the concept is native, the output will be a string.
-```toml
-# Filename: marketing_pipeline.toml
+```plx
+# Filename: marketing_pipeline.plx
domain = "marketing"
definition = "Marketing content generation domain"
@@ -159,4 +159,4 @@ if __name__ == "__main__":
- `execute_pipeline`: Runs the specified pipe and waits for it to complete, returning the final output. This is useful for simple, synchronous-style interactions.
- `start_pipeline`: Immediately returns a `pipeline_run_id` and an `asyncio.Task`. This allows you to run pipelines in the background and manage them asynchronously, which is essential for complex, long-running, or parallel workflows.
-By combining declarative TOML definitions with a powerful Python execution model, Pipelex gives you a robust framework for building and running reliable AI workflows.
+By combining declarative PLX definitions with a powerful Python execution model, Pipelex gives you a robust framework for building and running reliable AI workflows.
diff --git a/docs/pages/build-reliable-ai-workflows-with-pipelex/kick-off-a-knowledge-pipeline-project.md b/docs/pages/build-reliable-ai-workflows-with-pipelex/kick-off-a-knowledge-pipeline-project.md
index 6e0f48f67..cd405ee91 100644
--- a/docs/pages/build-reliable-ai-workflows-with-pipelex/kick-off-a-knowledge-pipeline-project.md
+++ b/docs/pages/build-reliable-ai-workflows-with-pipelex/kick-off-a-knowledge-pipeline-project.md
@@ -2,10 +2,10 @@
## Creating Your First Pipeline
-A pipeline in Pipelex is a collection of related concepts and pipes. Start by creating a TOML file in the `pipelines` directory:
+A pipeline in Pipelex is a collection of related concepts and pipes. Start by creating a PLX file in the `pipelines` directory:
-```toml
-# pipelex_libraries/pipelines/tutorial.toml
+```plx
+# pipelex_libraries/pipelines/tutorial.plx
domain = "tutorial"
definition = "My first Pipelex library"
@@ -43,9 +43,9 @@ A domain in Pipelex represents a topic or area of functionality within your pipe
### Domain in Practice
-When you create a pipeline file (`.toml`), you always start by declaring its domain:
+When you create a pipeline file (`.plx`), you always start by declaring its domain:
-```toml
+```plx
domain = "finance" # The domain name for this file
definition = "Financial document processing" # Optional description
system_prompt = "You are an expert financial analyst." # Optional system prompt for all PipeLLM in this domain
@@ -53,8 +53,8 @@ system_prompt = "You are an expert financial analyst." # Optional system prompt
A domain consists of:
-1. **Pipeline File** (`.toml`)
- ```toml
+1. **Pipeline File** (`.plx`)
+ ```plx
domain = "finance"
[concept]
@@ -99,7 +99,7 @@ A domain consists of:
2. **Organization**
- One domain per topic/functionality.
- - Match Python file names with domain names (`finance.toml` -> `finance.py`).
+ - Match Python file names with domain names (`finance.plx` -> `finance.py`).
- Keep related concepts within the same domain.
3. **Documentation**
@@ -126,13 +126,13 @@ invoice_stuff = StuffFactory.make_stuff(
Consistent naming makes your pipeline code discoverable and maintainable:
-### TOML Files
-- Use lowercase with underscores: `legal_contracts.toml`, `customer_service.toml`
-- Match the domain name when possible: domain "legal" → `legal.toml`
-- For multi-word domains, use underscores: domain "customer_service" → `customer_service.toml`
+### PLX Files
+- Use lowercase with underscores: `legal_contracts.plx`, `customer_service.plx`
+- Match the domain name when possible: domain "legal" → `legal.plx`
+- For multi-word domains, use underscores: domain "customer_service" → `customer_service.plx`
### Python Model Files
-- It is recommended to match the TOML filename exactly: `legal.toml` → `legal.py`
+- It is recommended to match the PLX filename exactly: `legal.plx` → `legal.py`
- But in any case, Pipelex will load models from all python modules in the `pipelines` directory or its subdirectories.
## Project Structure
@@ -144,7 +144,7 @@ your-project/
├── pipelex_libraries/ # All your pipeline code lives here
│ ├── pipelines/ # Pipeline definitions and models
│ │ ├── __init__.py
-│ │ ├── characters.toml # Domain definitions
+│ │ ├── characters.plx # Domain definitions
│ │ └── characters.py # Python models for concepts
│ ├── templates/ # Reusable prompt templates
│ ├── llm_integrations/ # LLM provider configurations
diff --git a/docs/pages/build-reliable-ai-workflows-with-pipelex/pipe-controllers/PipeBatch.md b/docs/pages/build-reliable-ai-workflows-with-pipelex/pipe-controllers/PipeBatch.md
index 72aacf975..7b471ecbc 100644
--- a/docs/pages/build-reliable-ai-workflows-with-pipelex/pipe-controllers/PipeBatch.md
+++ b/docs/pages/build-reliable-ai-workflows-with-pipelex/pipe-controllers/PipeBatch.md
@@ -16,9 +16,9 @@ This is the ideal controller for processing collections of documents, images, or
## Configuration
-`PipeBatch` is configured in your pipeline's `.toml` file.
+`PipeBatch` is configured in your pipeline's `.plx` file.
-### TOML Parameters
+### PLX Parameters
| Parameter | Type | Description | Required |
| ------------------ | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ | -------- |
@@ -40,7 +40,7 @@ This is the ideal controller for processing collections of documents, images, or
Suppose you have a list of articles and you want to generate a summary for each one.
-```toml
+```plx
# The pipe that knows how to summarize one article
[pipe.summarize_one_article]
type = "PipeLLM"
diff --git a/docs/pages/build-reliable-ai-workflows-with-pipelex/pipe-controllers/PipeCondition.md b/docs/pages/build-reliable-ai-workflows-with-pipelex/pipe-controllers/PipeCondition.md
index 824180b88..0edc60df9 100644
--- a/docs/pages/build-reliable-ai-workflows-with-pipelex/pipe-controllers/PipeCondition.md
+++ b/docs/pages/build-reliable-ai-workflows-with-pipelex/pipe-controllers/PipeCondition.md
@@ -13,9 +13,9 @@ The `PipeCondition` controller adds branching logic to your pipelines. It evalua
## Configuration
-`PipeCondition` is configured in your pipeline's `.toml` file.
+`PipeCondition` is configured in your pipeline's `.plx` file.
-### TOML Parameters
+### PLX Parameters
| Parameter | Type | Description | Required |
| ------------------------------ | -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ |
@@ -36,7 +36,7 @@ The `PipeCondition` controller adds branching logic to your pipelines. It evalua
Here's a basic example showing how PipeCondition routes based on input data:
-```toml
+```plx
domain = "routing_example"
definition = "Example of PipeCondition routing"
@@ -91,7 +91,7 @@ How this works:
### Example: Routing with default fallback
-```toml
+```plx
[pipe.route_with_fallback]
type = "PipeCondition"
description = "Route with default handling"
@@ -135,7 +135,7 @@ Process this unknown document type...
## Expression Types
### Simple Expression
-```toml
+```plx
expression = "input_data.category"
```
@@ -145,7 +145,7 @@ expression = "input_data.category"
- Access to Jinja2 filters and functions
### Complex Expression
-```toml
+```plx
expression_template = "{% if input_data.score >= 70 %}high{% else %}low{% endif %}"
```
@@ -164,7 +164,7 @@ default_pipe_code = "process_unknown"
- Fallback pipe when no match is found
### Expression Aliasing
-```toml
+```plx
add_alias_from_expression_to = "category_type"
```
diff --git a/docs/pages/build-reliable-ai-workflows-with-pipelex/pipe-controllers/PipeParallel.md b/docs/pages/build-reliable-ai-workflows-with-pipelex/pipe-controllers/PipeParallel.md
index 7efdae2bf..c0108dcd2 100644
--- a/docs/pages/build-reliable-ai-workflows-with-pipelex/pipe-controllers/PipeParallel.md
+++ b/docs/pages/build-reliable-ai-workflows-with-pipelex/pipe-controllers/PipeParallel.md
@@ -16,9 +16,9 @@ You must use `add_each_output`, `combined_output`, or both.
## Configuration
-`PipeParallel` is configured in your pipeline's `.toml` file.
+`PipeParallel` is configured in your pipeline's `.plx` file.
-### TOML Parameters
+### PLX Parameters
| Parameter | Type | Description | Required |
| ----------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------- |
@@ -43,7 +43,7 @@ Each entry in the `parallels` array is a table with the following keys:
Imagine you have a product description and you want to extract the product features and the product sentiment at the same time.
-```toml
+```plx
[concept.ProductAnalysis]
structure = "ProductAnalysis" # A Pydantic model with 'features' and 'sentiment' fields
diff --git a/docs/pages/build-reliable-ai-workflows-with-pipelex/pipe-controllers/PipeSequence.md b/docs/pages/build-reliable-ai-workflows-with-pipelex/pipe-controllers/PipeSequence.md
index ac306334f..062b53964 100644
--- a/docs/pages/build-reliable-ai-workflows-with-pipelex/pipe-controllers/PipeSequence.md
+++ b/docs/pages/build-reliable-ai-workflows-with-pipelex/pipe-controllers/PipeSequence.md
@@ -12,9 +12,9 @@ A `PipeSequence` defines a list of `steps`. Each step calls another pipe and giv
## Configuration
-`PipeSequence` is configured in your pipeline's `.toml` file.
+`PipeSequence` is configured in your pipeline's `.plx` file.
-### TOML Parameters
+### PLX Parameters
| Parameter | Type | Description | Required |
| ---------- | --------------- | -------------------------------------------------------------------------------------------------------------- | -------- |
@@ -39,7 +39,7 @@ Each entry in the `steps` array is a table with the following keys:
Let's imagine a pipeline that first extracts text from an image, then summarizes that text, and finally translates the summary into French.
-```toml
+```plx
[pipe.extract_text_from_image]
type = "PipeOcr"
description = "Extract text from an image"
diff --git a/docs/pages/build-reliable-ai-workflows-with-pipelex/pipe-operators/PipeFunc.md b/docs/pages/build-reliable-ai-workflows-with-pipelex/pipe-operators/PipeFunc.md
index 4122884ec..6281a9a0d 100644
--- a/docs/pages/build-reliable-ai-workflows-with-pipelex/pipe-operators/PipeFunc.md
+++ b/docs/pages/build-reliable-ai-workflows-with-pipelex/pipe-operators/PipeFunc.md
@@ -53,9 +53,9 @@ You would then call `register_my_functions()` when your Pipelex application init
## Configuration
-Once the function is registered, you can use it in your `.toml` file.
+Once the function is registered, you can use it in your `.plx` file.
-### TOML Parameters
+### PLX Parameters
| Parameter | Type | Description | Required |
| --------------- | ------ | --------------------------------------------------------------------------- | -------- |
@@ -66,9 +66,9 @@ Once the function is registered, you can use it in your `.toml` file.
### Example
-This TOML snippet shows how to use the `combine_two_texts` function defined above. It assumes two previous pipes have produced outputs named `text_a` and `text_b`.
+This PLX snippet shows how to use the `combine_two_texts` function defined above. It assumes two previous pipes have produced outputs named `text_a` and `text_b`.
-```toml
+```plx
[pipe.combine_them]
type = "PipeFunc"
description = "Combine two text inputs using a custom Python function"
diff --git a/docs/pages/build-reliable-ai-workflows-with-pipelex/pipe-operators/PipeImgGen.md b/docs/pages/build-reliable-ai-workflows-with-pipelex/pipe-operators/PipeImgGen.md
index 950b46aa9..be5ee2f2e 100644
--- a/docs/pages/build-reliable-ai-workflows-with-pipelex/pipe-operators/PipeImgGen.md
+++ b/docs/pages/build-reliable-ai-workflows-with-pipelex/pipe-operators/PipeImgGen.md
@@ -7,16 +7,16 @@ The `PipeImgGen` operator is used to generate images from a text prompt using a
`PipeImgGen` takes a text prompt and a set of parameters, then calls an underlying image generation service (like DALL-E 3 or Stable Diffusion) to create one or more images.
The prompt can be provided in two ways:
-1. As a static string directly in the pipe's TOML definition using the `imgg_prompt` parameter.
+1. As a static string directly in the pipe's PLX definition using the `imgg_prompt` parameter.
2. As a dynamic input by connecting a concept that is or refines `native.Text`.
The pipe can be configured to generate a single image or a list of images.
## Configuration
-`PipeImgGen` is configured in your pipeline's `.toml` file.
+`PipeImgGen` is configured in your pipeline's `.plx` file.
-### TOML Parameters
+### PLX Parameters
| Parameter | Type | Description | Required |
| ----------------------- | --------------- | ----------------------------------------------------------------------------------------------------------------------------- | -------- |
@@ -38,7 +38,7 @@ The pipe can be configured to generate a single image or a list of images.
This pipe generates one image of a futuristic car without requiring any input.
-```toml
+```plx
[pipe.generate_car_image]
type = "PipeImgGen"
description = "Generate a futuristic car image"
@@ -53,7 +53,7 @@ quality = "hd"
This pipe takes a text prompt as input and generates three variations of the image.
-```toml
+```plx
[concept]
ImagePrompt = "A text prompt for generating an image"
diff --git a/docs/pages/build-reliable-ai-workflows-with-pipelex/pipe-operators/PipeJinja2.md b/docs/pages/build-reliable-ai-workflows-with-pipelex/pipe-operators/PipeJinja2.md
index 32864f4a6..16ac09305 100644
--- a/docs/pages/build-reliable-ai-workflows-with-pipelex/pipe-operators/PipeJinja2.md
+++ b/docs/pages/build-reliable-ai-workflows-with-pipelex/pipe-operators/PipeJinja2.md
@@ -8,7 +8,7 @@ The `PipeJinja2` operator is a powerful utility for rendering [Jinja2 templates]
The template itself can be provided in one of two ways:
1. **By Name**: Referring to a template file that has been loaded into Pipelex's template provider. This is the most common and maintainable method.
-2. **Inline**: Providing the template as a multi-line string directly in the `.toml` file.
+2. **Inline**: Providing the template as a multi-line string directly in the `.plx` file.
### Templating Context
@@ -16,9 +16,9 @@ The Jinja2 template has access to all the "stuffs" currently in the working memo
## Configuration
-`PipeJinja2` is configured in your pipeline's `.toml` file.
+`PipeJinja2` is configured in your pipeline's `.plx` file.
-### TOML Parameters
+### PLX Parameters
| Parameter | Type | Description | Required |
| --------------- | --------------- | --------------------------------------------------------------------------------------------------------- | --------------------------- |
@@ -50,8 +50,8 @@ Here is a summary of your activity this week:
Report generated on: {{ report_date }}
```
-**Pipeline TOML definition:**
-```toml
+**Pipeline PLX definition:**
+```plx
[pipe.generate_weekly_report]
type = "PipeJinja2"
description = "Generate a formatted weekly report for a user"
diff --git a/docs/pages/build-reliable-ai-workflows-with-pipelex/pipe-operators/PipeLLM.md b/docs/pages/build-reliable-ai-workflows-with-pipelex/pipe-operators/PipeLLM.md
index 2f7ed4126..4b50efedb 100644
--- a/docs/pages/build-reliable-ai-workflows-with-pipelex/pipe-operators/PipeLLM.md
+++ b/docs/pages/build-reliable-ai-workflows-with-pipelex/pipe-operators/PipeLLM.md
@@ -21,7 +21,7 @@ For structured data output, `PipeLLM` employs two main strategies:
Images must be declared in the `inputs` section of your pipe definition. The image will be automatically passed to the VLM along with your text prompt.
-```toml
+```plx
[pipe.describe_image]
type = "PipeLLM"
description = "Describe an image"
@@ -38,7 +38,7 @@ Describe the provided image in great detail.
You can use any concept that refines `Image` as an input, and choose descriptive variable names that fit your use case:
-```toml
+```plx
[pipe.analyze_wedding]
type = "PipeLLM"
description = "Analyze wedding photo"
@@ -53,7 +53,7 @@ Analyze this wedding photo and describe the key moments captured.
When working with structured content that contains image fields (like `PageContent` which has a `page_view` field), you need to specify the full path to the image attribute in the `inputs` section:
-```toml
+```plx
[pipe.analyze_page_view]
type = "PipeLLM"
description = "Analyze the visual layout of a page"
@@ -74,7 +74,7 @@ In this example:
You can include multiple images in a single prompt by listing them in the inputs:
-```toml
+```plx
[pipe.compare_images]
type = "PipeLLM"
description = "Compare two images"
@@ -92,7 +92,7 @@ Compare these two images and describe their similarities and differences.
You can mix any stuff and image inputs in the same pipe:
-```toml
+```plx
[pipe.analyze_document_with_context]
type = "PipeLLM"
description = "Analyze a document page with additional context"
@@ -110,9 +110,9 @@ Analyze the document page shown in the image and explain how it relates to the p
## Configuration
-`PipeLLM` is configured in your pipeline's `.toml` file.
+`PipeLLM` is configured in your pipeline's `.plx` file.
-### TOML Parameters
+### PLX Parameters
| Parameter | Type | Description | Required |
| --------------------------- | ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- |
@@ -146,7 +146,7 @@ Analyze the document page shown in the image and explain how it relates to the p
This pipe takes no input and writes a poem.
-```toml
+```plx
[pipe.write_poem]
type = "PipeLLM"
description = "Write a short poem"
@@ -161,7 +161,7 @@ Write a four-line poem about pipes.
This pipe summarizes an input text, using a `prompt_template` to inject the input.
-```toml
+```plx
[pipe.summarize_text]
type = "PipeLLM"
description = "Summarize a text"
@@ -180,7 +180,7 @@ The summary should be no longer than 3 sentences.
This pipe takes an image of a table and uses a VLM to extract the content as an HTML table.
-```toml
+```plx
[pipe.extract_table_from_image]
type = "PipeLLM"
description = "Extract table data from an image"
@@ -195,7 +195,7 @@ Extract the table data from this image and format it as a structured table.
This pipe extracts a list of `Expense` items from a block of text.
-```toml
+```plx
[concept.Expense]
structure = "Expense" # Assumes a Pydantic model 'Expense' is defined
diff --git a/docs/pages/build-reliable-ai-workflows-with-pipelex/pipe-operators/PipeOcr.md b/docs/pages/build-reliable-ai-workflows-with-pipelex/pipe-operators/PipeOcr.md
index 1090ee360..643037dbc 100644
--- a/docs/pages/build-reliable-ai-workflows-with-pipelex/pipe-operators/PipeOcr.md
+++ b/docs/pages/build-reliable-ai-workflows-with-pipelex/pipe-operators/PipeOcr.md
@@ -19,9 +19,9 @@ The `PageContent` object has the following structure:
## Configuration
-`PipeOcr` is configured in your pipeline's `.toml` file.
+`PipeOcr` is configured in your pipeline's `.plx` file.
-### TOML Parameters
+### PLX Parameters
| Parameter | Type | Description | Required |
| --------------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------- | -------- |
@@ -38,7 +38,7 @@ The `PageContent` object has the following structure:
This example defines a pipe that takes a PDF, extracts text and full-page images, and outputs them as a list of pages.
-```toml
+```plx
[concept]
ScannedDocument = "A document that has been scanned as a PDF"
diff --git a/docs/pages/build-reliable-ai-workflows-with-pipelex/pipe-operators/pipe_toml.png b/docs/pages/build-reliable-ai-workflows-with-pipelex/pipe-operators/pipe_plx.png
similarity index 100%
rename from docs/pages/build-reliable-ai-workflows-with-pipelex/pipe-operators/pipe_toml.png
rename to docs/pages/build-reliable-ai-workflows-with-pipelex/pipe-operators/pipe_plx.png
diff --git a/docs/pages/build-reliable-ai-workflows-with-pipelex/pipeline-creation.md b/docs/pages/build-reliable-ai-workflows-with-pipelex/pipeline-creation.md
index f4f92c375..5dca68640 100644
--- a/docs/pages/build-reliable-ai-workflows-with-pipelex/pipeline-creation.md
+++ b/docs/pages/build-reliable-ai-workflows-with-pipelex/pipeline-creation.md
@@ -7,7 +7,7 @@ Pipelex provides powerful tools to automatically generate pipeline blueprints fr
The pipeline creation system works in several stages:
1. **Draft Generation**: Convert natural language requirements into structured markdown drafts
-2. **Blueprint Creation**: Transform drafts into formal pipeline blueprints (TOML format)
+2. **Blueprint Creation**: Transform drafts into formal pipeline blueprints (PLX format)
3. **Validation**: Automatically validate and fix common issues
4. **Implementation**: Generate executable pipeline code
@@ -60,7 +60,7 @@ pipelex validate blueprint BLUEPRINT_PATH [OPTIONS]
**Example:**
```bash
-pipelex validate blueprint pipelex/libraries/pipelines/temp/result_3/photopposite.toml \
+pipelex validate blueprint pipelex/libraries/pipelines/temp/result_3/photopposite.plx \
-c pipelex/libraries
```
@@ -116,9 +116,9 @@ Returns: `opposite_photo` - Photo showing opposite of main feature
### 3. Blueprint Creation
-The draft is converted into a formal TOML blueprint:
+The draft is converted into a formal PLX blueprint:
-```toml
+```plx
domain = "image_processing"
definition = "Generate opposite version of photo's main feature"
@@ -173,7 +173,7 @@ output = "Image"
The system automatically:
-- **Validates syntax**: Ensures TOML structure is correct
+- **Validates syntax**: Ensures PLX structure is correct
- **Checks concepts**: Verifies all concepts are properly defined
- **Validates inputs**: Ensures all pipe inputs are available
- **Fixes errors**: Automatically adds missing inputs or corrects common issues
@@ -185,9 +185,9 @@ When you run the build command, several files are created:
```
output_path_base_draft.md # Original markdown draft
-output_path_base_rough.toml # Initial blueprint
+output_path_base_rough.plx # Initial blueprint
output_path_base_rough.json # Blueprint in JSON format
-output_path_base_fixed.toml # Validated and fixed blueprint (if --validate used)
+output_path_base_fixed.plx # Validated and fixed blueprint (if --validate used)
output_path_base_fixed.json # Fixed blueprint in JSON format
```
@@ -223,7 +223,7 @@ pipelex/libraries/pipelines/
result_1/
result_2/
domain_name/ # Production pipelines
- pipeline_name.toml
+ pipeline_name.plx
structures.py
```
@@ -277,7 +277,7 @@ pipelex validate all -c pipelex/libraries
pipelex validate pipe your_pipe_name -c pipelex/libraries
# Check blueprint structure
-pipelex validate blueprint your_blueprint.toml -c pipelex/libraries --no-fix
+pipelex validate blueprint your_blueprint.plx -c pipelex/libraries --no-fix
```
## Next Steps
diff --git a/docs/pages/configuration/config-technical/library-config.md b/docs/pages/configuration/config-technical/library-config.md
index d5265ac96..f1e7615a9 100644
--- a/docs/pages/configuration/config-technical/library-config.md
+++ b/docs/pages/configuration/config-technical/library-config.md
@@ -32,7 +32,7 @@ pipelex_libraries/ # Exported library root
2. **Concept Loading**:
- Loads native concepts first
- - Loads custom concepts from TOML files
+ - Loads custom concepts from PLX files
- Validates concept definitions and relationships
3. **Pipe Loading**:
@@ -107,7 +107,7 @@ The library manager performs several validation steps:
The library system includes specific error types:
- `LibraryError`: Base error for library issues
-- `LibraryParsingError`: For TOML parsing issues
+- `LibraryParsingError`: For PLX parsing issues
- `ConceptLibraryError`: For concept-related issues
- `PipeLibraryError`: For pipe-related issues
- `LLMDeckNotFoundError`: For missing LLM configurations
@@ -116,7 +116,7 @@ The library system includes specific error types:
1. **Organization**:
- - Keep related concepts and pipes in the same TOML file
+ - Keep related concepts and pipes in the same PLX file
- Use meaningful domain names
- Structure complex libraries using subdirectories
diff --git a/docs/pages/cookbook-examples/extract-dpe.md b/docs/pages/cookbook-examples/extract-dpe.md
index f0047ece3..685ac210b 100644
--- a/docs/pages/cookbook-examples/extract-dpe.md
+++ b/docs/pages/cookbook-examples/extract-dpe.md
@@ -54,11 +54,11 @@ class Dpe(StructuredContent):
yearly_energy_costs: Optional[float] = None
```
-## The Pipeline Definition: `extract_dpe.toml`
+## The Pipeline Definition: `extract_dpe.plx`
The pipeline uses a `PipeLLM` with a very specific prompt to extract the information from the document. The combination of the image and the OCR text allows the LLM to accurately capture all the details.
-```toml
+```plx
[pipe.write_markdown_from_page_content_dpe]
type = "PipeLLM"
description = "Write markdown from page content of a 'Diagnostic de Performance Energetique'"
diff --git a/docs/pages/cookbook-examples/extract-gantt.md b/docs/pages/cookbook-examples/extract-gantt.md
index 7f85825ae..2bbe8ac83 100644
--- a/docs/pages/cookbook-examples/extract-gantt.md
+++ b/docs/pages/cookbook-examples/extract-gantt.md
@@ -53,11 +53,11 @@ class GanttChart(StructuredContent):
milestones: Optional[List[Milestone]]
```
-## The Pipeline Definition: `gantt.toml`
+## The Pipeline Definition: `gantt.plx`
The `extract_gantt_by_steps` pipeline is a sequence of smaller, focused pipes. This is a great example of building a complex workflow from simple, reusable components.
-```toml
+```plx
[pipe.extract_gantt_by_steps]
type = "PipeSequence"
description = "Extract all details from a gantt chart"
diff --git a/docs/pages/cookbook-examples/extract-proof-of-purchase.md b/docs/pages/cookbook-examples/extract-proof-of-purchase.md
index 59f56b423..792a4d27c 100644
--- a/docs/pages/cookbook-examples/extract-proof-of-purchase.md
+++ b/docs/pages/cookbook-examples/extract-proof-of-purchase.md
@@ -50,11 +50,11 @@ class ProofOfPurchase(StructuredContent):
```
This demonstrates how you can create nested data structures to accurately model your data.
-## The Pipeline Definition: `extract_proof_of_purchase.toml`
+## The Pipeline Definition: `extract_proof_of_purchase.plx`
The pipeline uses a powerful `PipeLLM` to extract the structured data from the document. The prompt is carefully engineered to guide the LLM.
-```toml
+```plx
[pipe.write_markdown_from_page_content_proof_of_purchase]
type = "PipeLLM"
description = "Write markdown from page content"
diff --git a/docs/pages/cookbook-examples/extract-table.md b/docs/pages/cookbook-examples/extract-table.md
index b083be2e2..54b58a591 100644
--- a/docs/pages/cookbook-examples/extract-table.md
+++ b/docs/pages/cookbook-examples/extract-table.md
@@ -55,11 +55,11 @@ class HtmlTable(StructuredContent):
return self
```
-## The Pipeline Definition: `table.toml`
+## The Pipeline Definition: `table.plx`
The pipeline uses a two-step "extract and review" pattern. The first pipe does the initial extraction, and the second pipe reviews the generated HTML against the original image to correct any errors. This is a powerful pattern for increasing the reliability of LLM outputs.
-```toml
+```plx
[pipe.extract_html_table_and_review]
type = "PipeSequence"
description = "Get an HTML table and review it"
diff --git a/docs/pages/cookbook-examples/hello-world.md b/docs/pages/cookbook-examples/hello-world.md
index 866893c10..2882a2289 100644
--- a/docs/pages/cookbook-examples/hello-world.md
+++ b/docs/pages/cookbook-examples/hello-world.md
@@ -41,11 +41,11 @@ asyncio.run(hello_world())
This example shows the minimal setup needed to run a Pipelex pipeline: initialize Pipelex, execute a pipeline by its code name, and pretty-print the results.
-## The Pipeline Definition: `hello_world.toml`
+## The Pipeline Definition: `hello_world.plx`
The pipeline definition is extremely simple - it's a single LLM call that generates a haiku:
-```toml
+```plx
domain = "quick_start"
definition = "Discovering Pipelex"
diff --git a/docs/pages/cookbook-examples/invoice-extractor.md b/docs/pages/cookbook-examples/invoice-extractor.md
index 433919f14..5824c5362 100644
--- a/docs/pages/cookbook-examples/invoice-extractor.md
+++ b/docs/pages/cookbook-examples/invoice-extractor.md
@@ -57,11 +57,11 @@ class Invoice(StructuredContent):
# ... other fields
```
-## The Pipeline Definition: `invoice.toml`
+## The Pipeline Definition: `invoice.plx`
-The entire workflow is defined in a TOML file. This declarative approach makes the pipeline easy to understand and modify. Here's a snippet from `invoice.toml`:
+The entire workflow is defined in a PLX file. This declarative approach makes the pipeline easy to understand and modify. Here's a snippet from `invoice.plx`:
-```toml
+```plx
# The main pipeline, a sequence of steps
[pipe.process_invoice]
type = "PipeSequence"
diff --git a/docs/pages/cookbook-examples/write-screenplay.md b/docs/pages/cookbook-examples/write-screenplay.md
index 3e82ae790..6cc8db9b0 100644
--- a/docs/pages/cookbook-examples/write-screenplay.md
+++ b/docs/pages/cookbook-examples/write-screenplay.md
@@ -75,11 +75,11 @@ class Screenplay(StructuredContent):
chapters: "ChapterList"
```
-## The Pipeline Definition: `screenplay_writer.toml`
+## The Pipeline Definition: `screenplay_writer.plx`
The `generate_screenplay` pipeline is a master `PipeSequence` that orchestrates a series of smaller, specialized pipes. This is a perfect example of how to build a complex, creative workflow by breaking it down into manageable steps.
-```toml
+```plx
[pipe.generate_screenplay]
type = "PipeSequence"
description = "Generate a complete screenplay from a pitch"
diff --git a/docs/pages/cookbook-examples/write-tweet.md b/docs/pages/cookbook-examples/write-tweet.md
index 8de0d6422..224d84f0f 100644
--- a/docs/pages/cookbook-examples/write-tweet.md
+++ b/docs/pages/cookbook-examples/write-tweet.md
@@ -55,11 +55,11 @@ class OptimizedTweet(TextContent):
pass
```
-## The Pipeline Definition: `tech_tweet.toml`
+## The Pipeline Definition: `tech_tweet.plx`
This pipeline uses a two-step "analyze and optimize" sequence. The first pipe analyzes the draft tweet for common pitfalls, and the second pipe rewrites the tweet based on the analysis and a provided writing style. This is a powerful pattern for refining generated content.
-```toml
+```plx
[pipe.optimize_tweet_sequence]
type = "PipeSequence"
description = "Analyze and optimize a tech tweet in sequence"
diff --git a/docs/pages/migration/index.md b/docs/pages/migration/index.md
index 1db102a3e..92c6b2a81 100644
--- a/docs/pages/migration/index.md
+++ b/docs/pages/migration/index.md
@@ -6,19 +6,19 @@ This document provides guidance for migrating between different versions of Pipe
### Breaking Change
-We changed the syntax for defining concepts in TOML library files. The key name for concept definitions has changed from `Concept` to `definition`.
+We changed the syntax for defining concepts in PLX library files. The key name for concept definitions has changed from `Concept` to `definition`.
### What Changed
**Old syntax:**
-```toml
+```plx
[concept.MyConceptName]
Concept = "Description of the concept"
refines = "Text"
```
**New syntax:**
-```toml
+```plx
[concept.MyConceptName]
definition = "Description of the concept"
refines = "Text"
@@ -26,29 +26,29 @@ refines = "Text"
### Why This Change
-This change improves consistency in our TOML schema by:
+This change improves consistency in our PLX schema by:
- Using more descriptive field names (`definition` instead of `Concept`)
- Aligning with the internal `ConceptBlueprint` data structure
-- Making the TOML files more self-documenting and intuitive
+- Making the PLX files more self-documenting and intuitive
### Migration Process
#### Automatic Migration
-Use the built-in migration command to automatically update your TOML files:
+Use the built-in migration command to automatically update your PLX files:
```bash
# Preview changes without applying them
pipelex migrate --dry-run
-# Apply the migration to all TOML files
+# Apply the migration to all PLX files
pipelex migrate
```
The migration command will:
-- Find all `.toml` files in your configured pipelines directory
+- Find all `.plx` files in your configured pipelines directory
- Replace `Concept =` with `definition =` in concept definitions
- Preserve all other formatting and comments
- Create backups of modified files (with `.backup` extension)
@@ -57,7 +57,7 @@ The migration command will:
If you prefer to migrate manually or need to handle special cases:
-1. **Locate your TOML files**: Find all pipeline library files (typically in your configured pipelines directory)
+1. **Locate your PLX files**: Find all pipeline library files (typically in your configured pipelines directory)
2. **Update concept definitions**: Change `Concept =` to `definition =` in all `[concept.ConceptName]` sections
3. **Validate syntax**: Run `pipelex validate all -c pipelex/libraries` to ensure your files are correctly formatted
@@ -66,14 +66,14 @@ If you prefer to migrate manually or need to handle special cases:
#### Simple Concept Definition
**Before:**
-```toml
+```plx
[concept.Article]
Concept = "A written composition on a specific topic"
refines = "Text"
```
**After:**
-```toml
+```plx
[concept.Article]
definition = "A written composition on a specific topic"
refines = "Text"
@@ -82,7 +82,7 @@ refines = "Text"
#### Complex Concept with Structure
**Before:**
-```toml
+```plx
[concept.Photo]
Concept = "Photo"
structure = "ImageContent"
@@ -90,7 +90,7 @@ refines = "Image"
```
**After:**
-```toml
+```plx
[concept.Photo]
definition = "Photo"
structure = "ImageContent"
@@ -115,12 +115,12 @@ pipelex run your-pipeline-name
- Check that all `Concept =` entries have been changed to `definition =`
- Ensure no typos were introduced during migration
-- Verify TOML syntax is still valid
+- Verify PLX syntax is still valid
-**Error: "Failed to load TOML file"**
+**Error: "Failed to load PLX file"**
- Check file permissions
-- Ensure TOML syntax is valid (no missing quotes, brackets, etc.)
+- Ensure PLX syntax is valid (no missing quotes, brackets, etc.)
- Review any custom modifications that might conflict
### Rollback
@@ -135,18 +135,18 @@ If you need to rollback the migration:
### Breaking Change
-We changed the syntax for defining pipes in TOML library files. The pipe definition format has been restructured to use explicit `type` and `definition` fields instead of the implicit `PipeClassName = "description"` format.
+We changed the syntax for defining pipes in PLX library files. The pipe definition format has been restructured to use explicit `type` and `definition` fields instead of the implicit `PipeClassName = "description"` format.
### What Changed
**Old syntax:**
-```toml
+```plx
[pipe.my_pipe_name]
SomePipeClass = "Description of what this pipe does"
```
**New syntax:**
-```toml
+```plx
[pipe.my_pipe_name]
type = "SomePipeClass"
definition = "Description of what this pipe does"
@@ -158,26 +158,26 @@ This change improves consistency and clarity by:
- Making the pipe class type explicit and separate from its description
- Aligning pipe definitions with concept definitions (both use `definition`)
-- Improving readability and maintainability of TOML files
+- Improving readability and maintainability of PLX files
- Making it easier to parse and validate pipe configurations
### Migration Process
#### Automatic Migration
-Use the built-in migration command to automatically update your TOML files:
+Use the built-in migration command to automatically update your PLX files:
```bash
# Preview changes without applying them
pipelex migrate --dry-run
-# Apply the migration to all TOML files
+# Apply the migration to all PLX files
pipelex migrate
```
The migration command will:
-- Find all `.toml` files in your configured pipelines directory
+- Find all `.plx` files in your configured pipelines directory
- Convert `PipeClassName = "description"` to `type = "PipeClassName"` and `definition = "description"`
- Preserve all other formatting and comments
- Create backups of modified files (with `.backup` extension)
@@ -186,7 +186,7 @@ The migration command will:
If you prefer to migrate manually:
-1. **Locate your TOML files**: Find all pipeline library files
+1. **Locate your PLX files**: Find all pipeline library files
2. **Update pipe definitions**:
- Find all `[pipe.pipe_name]` sections
- Replace `PipeClassName = "description"` with:
@@ -199,13 +199,13 @@ If you prefer to migrate manually:
#### Simple Pipe Definition
**Before:**
-```toml
+```plx
[pipe.summarize_article]
TextSummarizer = "Summarize the given article into key points"
```
**After:**
-```toml
+```plx
[pipe.summarize_article]
type = "TextSummarizer"
definition = "Summarize the given article into key points"
@@ -214,7 +214,7 @@ definition = "Summarize the given article into key points"
#### Pipe with Additional Configuration
**Before:**
-```toml
+```plx
[pipe.analyze_sentiment]
SentimentAnalyzer = "Analyze the sentiment of the input text"
model = "bert-base-uncased"
@@ -222,7 +222,7 @@ threshold = 0.8
```
**After:**
-```toml
+```plx
[pipe.analyze_sentiment]
type = "SentimentAnalyzer"
definition = "Analyze the sentiment of the input text"
diff --git a/docs/pages/quick-start/index.md b/docs/pages/quick-start/index.md
index 196442eee..1f5ef9420 100644
--- a/docs/pages/quick-start/index.md
+++ b/docs/pages/quick-start/index.md
@@ -13,11 +13,11 @@ For illustration purposes, let's build **a character generator**. Each example r
### Write your first pipeline
-First, create a `.toml` library file in the `pipelex_libraries/pipelines` directory to store your pipe definition.
+First, create a `.plx` library file in the `pipelex_libraries/pipelines` directory to store your pipe definition.
Run `pipelex init libraries` to create this directory if it doesn't exist. For now, keep all your pipeline definitions inside that folder only.
-`character.toml`
-```toml
+`character.plx`
+```plx
domain = "characters"
[pipe]
@@ -66,7 +66,7 @@ python character.py
### Indicate your LLM selection explicitly using the `llm` attribute
-```toml
+```plx
[pipe.create_character]
type = "PipeLLM"
description = "Create a character."
@@ -78,7 +78,7 @@ Think of it and then output the character description."""
### Or use an LLM preset from the LLM deck
-```toml
+```plx
[pipe.create_character]
type = "PipeLLM"
description = "Create a character."
@@ -118,16 +118,14 @@ class Character(StructuredContent):
description: str
```
-ℹ️ We'll soon make it possible to define your structure directly in the `.toml` file, without having to write any python code
-
### Improve the pipeline
It's time to specify that your output be a `Character` instance. Use the `output` field for that purpose.
💡 Here, the concept name matches the class name (ie. `Character`), the `Character` class will automatically be considered as the structure to output.
-`pipelex_libraries/pipelines/characters.toml`
-```toml
+`pipelex_libraries/pipelines/characters.plx`
+```plx
domain = "characters"
[concept]
@@ -185,7 +183,7 @@ class CharacterMetadata(StructuredContent):
💡 Our template syntax is based on [Jinja2 syntax](https://jinja.palletsprojects.com/en/stable/). You can include a variable using the **classic** `{{ double.curly.braces }}`, and to make it simpler, we've added the possibility to just prefix your variable with the `@` symbol (recommended). Pipes declare their required inputs explicitly with the `inputs` table:
-```toml
+```plx
[concept]
Character = "A character from a book"
CharacterMetadata = "Metadata regarding a character."
diff --git a/pipelex/cli/commands/build_cmd.py b/pipelex/cli/commands/build_cmd.py
index c22707e61..7f8c5f87e 100644
--- a/pipelex/cli/commands/build_cmd.py
+++ b/pipelex/cli/commands/build_cmd.py
@@ -35,7 +35,7 @@ def build_draft_pipeline_cmd(
] = None,
output_path: Annotated[
Optional[str],
- typer.Option("--output", "-o", help="Path to save the generated TOML blueprint (optional)"),
+ typer.Option("--output", "-o", help="Path to save the generated PLX blueprint (optional)"),
] = None,
raw: Annotated[
bool,
@@ -104,7 +104,7 @@ def build_blueprint_cmd(
] = None,
output_path: Annotated[
Optional[str],
- typer.Option("--output", "-o", help="Path to save the generated TOML blueprint (optional)"),
+ typer.Option("--output", "-o", help="Path to save the generated PLX blueprint (optional)"),
] = None,
validate: Annotated[
bool,
diff --git a/pipelex/cli/commands/migrate_cmd.py b/pipelex/cli/commands/migrate_cmd.py
index 63b06ba4e..c6cd93cb9 100644
--- a/pipelex/cli/commands/migrate_cmd.py
+++ b/pipelex/cli/commands/migrate_cmd.py
@@ -6,7 +6,7 @@ from typing import Annotated
import typer
from pipelex.cli.commands.common import is_pipelex_libraries_folder
-from pipelex.migration.migrate_v0_1_0_to_v0_2_0 import TomlMigrator, migrate_concept_syntax
+from pipelex.migration.migrate_v0_1_0_to_v0_2_0 import TOMLMigrator, migrate_concept_syntax
from pipelex.migration.migration_result import MigrationResult
@@ -54,7 +54,7 @@ def do_migrate(
return
if dry_run:
- migrator = TomlMigrator()
+ migrator = TOMLMigrator()
# For display, if a single file path was provided, show relative to its parent
base_for_print = pipelines_dir_or_file if pipelines_dir_or_file.is_dir() else pipelines_dir_or_file.parent
for file_path in result.modified_files:
@@ -91,7 +91,7 @@ def do_migrate(
typer.echo(f"\n✅ Migration completed: {result.total_changes} change(s) applied to {result.files_modified} file(s)")
if create_backups:
typer.echo(" Backup files created with .backup extension")
- typer.echo(" Run 'pipelex validate all' to verify the migration")
+ typer.echo(" Run 'pipelex validate all -c pipelex/libraries' to verify the migration")
except FileNotFoundError as exc:
typer.echo(f"❌ {exc}")
raise typer.Exit(1)
diff --git a/pipelex/cogt/llm/llm_prompt_template.py b/pipelex/cogt/llm/llm_prompt_template.py
index 6f8bdcd17..791b8ba0f 100644
--- a/pipelex/cogt/llm/llm_prompt_template.py
+++ b/pipelex/cogt/llm/llm_prompt_template.py
@@ -43,6 +43,8 @@ class LLMPromptTemplate(LLMPromptFactoryAbstract):
# pop the base fields and then use the templating method
system_text: Optional[str] = arguments_dict.pop("system_text", None)
user_text: Optional[str] = arguments_dict.pop("user_text", None)
+ if not user_text:
+ user_text = self.proto_prompt.user_text
# user_images is Optional here: None means the template is not altering the user_images field
user_images: Optional[List[PromptImage]] = None
diff --git a/pipelex/core/bundles/pipelex_bundle_blueprint.py b/pipelex/core/bundles/pipelex_bundle_blueprint.py
index 0fac74d70..2c30c07c2 100644
--- a/pipelex/core/bundles/pipelex_bundle_blueprint.py
+++ b/pipelex/core/bundles/pipelex_bundle_blueprint.py
@@ -33,7 +33,7 @@ PipeBlueprintUnion = Annotated[
class PipelexBundleBlueprint(BaseModel):
- """Complete blueprint of a pipelex bundle TOML definition."""
+ """Complete blueprint of a pipelex bundle PLX definition."""
model_config = ConfigDict(extra="forbid")
diff --git a/pipelex/core/interpreter.py b/pipelex/core/interpreter.py
index fd5bbe10a..4d8bae7fc 100644
--- a/pipelex/core/interpreter.py
+++ b/pipelex/core/interpreter.py
@@ -21,15 +21,21 @@ from pipelex.pipe_operators.ocr.pipe_ocr_blueprint import PipeOcrBlueprint
from pipelex.tools.misc.toml_utils import clean_trailing_whitespace, validate_toml_content, validate_toml_file
+class PLXDecodeError(toml.TomlDecodeError):
+ """Raised when PLX decoding fails."""
+
+ pass
+
+
class PipelexInterpreter(BaseModel):
- """TOML -> PipelexBundleBlueprint"""
+ """plx -> PipelexBundleBlueprint"""
file_path: Optional[Path] = None
file_content: Optional[str] = None
@staticmethod
- def escape_toml_string(value: Optional[str]) -> str:
- """Escape a string for TOML serialization."""
+ def escape_plx_string(value: Optional[str]) -> str:
+ """Escape a string for plx serialization."""
if value is None:
return ""
# Escape backslashes first (must be done first)
@@ -58,7 +64,7 @@ class PipelexInterpreter(BaseModel):
return self
def get_file_content(self) -> str:
- """Load TOML content from file_path or use file_content directly."""
+ """Load PLX content from file_path or use file_content directly."""
if self.file_path:
try:
with open(self.file_path, "r", encoding="utf-8") as file:
@@ -70,18 +76,17 @@ class PipelexInterpreter(BaseModel):
with open(self.file_path, "w", encoding="utf-8") as file:
file.write(cleaned_content)
return cleaned_content
-
return file_content
except Exception as exc:
- raise PipelexFileError(f"Failed to read TOML file '{self.file_path}': {exc}") from exc
+ raise PipelexFileError(f"Failed to read PLX file '{self.file_path}': {exc}") from exc
elif self.file_content is None:
raise PipelexConfigurationError("file_content must be provided if file_path is not provided")
return self.file_content
@staticmethod
def is_pipelex_file(file_path: Path) -> bool:
- """Check if a file is a valid Pipelex TOML file.
+ """Check if a file is a valid Pipelex PLX file.
Args:
file_path: Path to the file to check
@@ -90,11 +95,11 @@ class PipelexInterpreter(BaseModel):
True if the file is a Pipelex file, False otherwise
Criteria:
- - Has .toml extension
+ - Has .plx extension
- Starts with "domain =" (ignoring leading whitespace)
"""
# Check if it has .toml extension
- if file_path.suffix != ".toml":
+ if file_path.suffix != ".plx":
return False
# Check if file exists
@@ -113,136 +118,136 @@ class PipelexInterpreter(BaseModel):
# If we can't read the file, it's not a valid Pipelex file
return False
- def _parse_toml_content(self, content: str) -> Dict[str, Any]:
- """Parse TOML content and return the dictionary."""
+ def _parse_plx_content(self, content: str) -> Dict[str, Any]:
+ """Parse PLX content and return the dictionary."""
try:
return toml.loads(content)
except toml.TomlDecodeError as exc:
file_path_str = str(self.file_path) if self.file_path else "content"
- raise toml.TomlDecodeError(f"TOML parsing error in '{file_path_str}': {exc}", exc.doc, exc.pos) from exc
+ raise PLXDecodeError(f"PLX parsing error in '{file_path_str}': {exc}", exc.doc, exc.pos) from exc
def make_pipelex_bundle_blueprint(self) -> PipelexBundleBlueprint:
"""Make a PipelexBundleBlueprint from the file_path or file_content"""
file_content = self.get_file_content()
- toml_data = self._parse_toml_content(file_content)
- return PipelexBundleBlueprint.model_validate(toml_data)
+ plx_data = self._parse_plx_content(file_content)
+ return PipelexBundleBlueprint.model_validate(plx_data)
@staticmethod
- def make_toml_content(blueprint: PipelexBundleBlueprint) -> str:
- """Convert a PipelexBundleBlueprint to properly formatted TOML content."""
- toml_parts: list[str] = []
+ def make_plx_content(blueprint: PipelexBundleBlueprint) -> str:
+ """Convert a PipelexBundleBlueprint to properly formatted PLX content."""
+ plx_parts: list[str] = []
# Domain-level fields
domain_fields: list[str] = []
- domain_fields.append(f'domain = "{PipelexInterpreter.escape_toml_string(blueprint.domain)}"')
+ domain_fields.append(f'domain = "{PipelexInterpreter.escape_plx_string(blueprint.domain)}"')
if blueprint.definition:
- domain_fields.append(f'definition = "{PipelexInterpreter.escape_toml_string(blueprint.definition)}"')
+ domain_fields.append(f'definition = "{PipelexInterpreter.escape_plx_string(blueprint.definition)}"')
if blueprint.system_prompt:
- domain_fields.append(f'system_prompt = "{PipelexInterpreter.escape_toml_string(blueprint.system_prompt)}"')
+ domain_fields.append(f'system_prompt = "{PipelexInterpreter.escape_plx_string(blueprint.system_prompt)}"')
if blueprint.system_prompt_to_structure:
- domain_fields.append(f'system_prompt_to_structure = "{PipelexInterpreter.escape_toml_string(blueprint.system_prompt_to_structure)}"')
+ domain_fields.append(f'system_prompt_to_structure = "{PipelexInterpreter.escape_plx_string(blueprint.system_prompt_to_structure)}"')
if blueprint.prompt_template_to_structure:
- domain_fields.append(f'prompt_template_to_structure = "{PipelexInterpreter.escape_toml_string(blueprint.prompt_template_to_structure)}"')
+ domain_fields.append(f'prompt_template_to_structure = "{PipelexInterpreter.escape_plx_string(blueprint.prompt_template_to_structure)}"')
- toml_parts.append("\n".join(domain_fields))
+ plx_parts.append("\n".join(domain_fields))
# Concepts section
if blueprint.concept:
- concept_toml = PipelexInterpreter.concepts_to_toml_string(blueprint.concept, blueprint.domain)
- if concept_toml: # Only add if not empty
- toml_parts.append(concept_toml)
+ concept_plx = PipelexInterpreter.concepts_to_plx_string(blueprint.concept, blueprint.domain)
+ if concept_plx: # Only add if not empty
+ plx_parts.append(concept_plx)
# Pipes section
if blueprint.pipe:
- pipes_toml = PipelexInterpreter.pipes_to_toml_string(blueprint.pipe, blueprint.domain)
- if pipes_toml: # Only add if not empty
- toml_parts.append(pipes_toml)
+ pipes_plx = PipelexInterpreter.pipes_to_plx_string(blueprint.pipe, blueprint.domain)
+ if pipes_plx: # Only add if not empty
+ plx_parts.append(pipes_plx)
- result = "\n\n".join(toml_parts)
+ result = "\n\n".join(plx_parts)
if result and not result.endswith("\n"):
result += "\n"
return result
@staticmethod
- def concepts_to_toml_string(concepts: Dict[str, ConceptBlueprint | str], domain: str) -> str:
- """Convert concepts dict to TOML string."""
+ def concepts_to_plx_string(concepts: Dict[str, ConceptBlueprint | str], domain: str) -> str:
+ """Convert concepts dict to PLX string."""
if not concepts:
return ""
- toml_parts: list[str] = []
+ plx_parts: list[str] = []
simple_concepts: list[str] = []
complex_concepts: list[str] = []
for concept_name, concept_blueprint in concepts.items():
if isinstance(concept_blueprint, str):
- simple_concepts.append(f'{concept_name} = "{PipelexInterpreter.escape_toml_string(concept_blueprint)}"')
+ simple_concepts.append(f'{concept_name} = "{PipelexInterpreter.escape_plx_string(concept_blueprint)}"')
else:
# Handle ConceptBlueprint objects
if concept_blueprint.structure is None and concept_blueprint.refines is None:
# Simple concept with just definition
- simple_concepts.append(f'{concept_name} = "{PipelexInterpreter.escape_toml_string(concept_blueprint.definition)}"')
+ simple_concepts.append(f'{concept_name} = "{PipelexInterpreter.escape_plx_string(concept_blueprint.definition)}"')
else:
# Complex concept needs its own section
- complex_concept_toml = PipelexInterpreter.complex_concept_to_toml_string(concept_name, concept_blueprint)
- complex_concepts.append(complex_concept_toml)
+ complex_concept_plx = PipelexInterpreter.complex_concept_to_plx_string(concept_name, concept_blueprint)
+ complex_concepts.append(complex_concept_plx)
# Add simple concepts section if we have any
if simple_concepts:
- toml_parts.append("[concept]")
- toml_parts.extend(simple_concepts)
+ plx_parts.append("[concept]")
+ plx_parts.extend(simple_concepts)
# Add complex concepts with proper spacing
if complex_concepts:
# If we had simple concepts, add an empty line before complex ones
if simple_concepts:
- toml_parts.append("")
+ plx_parts.append("")
# Add each complex concept with empty lines between them
for i, complex_concept in enumerate(complex_concepts):
if i > 0: # Add empty line between complex concepts
- toml_parts.append("")
- toml_parts.append(complex_concept)
+ plx_parts.append("")
+ plx_parts.append(complex_concept)
- return "\n".join(toml_parts)
+ return "\n".join(plx_parts)
@staticmethod
- def complex_concept_to_toml_string(concept_name: str, concept: ConceptBlueprint) -> str:
- """Convert a complex ConceptBlueprint to TOML string."""
+ def complex_concept_to_plx_string(concept_name: str, concept: ConceptBlueprint) -> str:
+ """Convert a complex ConceptBlueprint to PLX string."""
lines: list[str] = [f"[concept.{concept_name}]"]
if concept.definition:
- lines.append(f'definition = "{PipelexInterpreter.escape_toml_string(concept.definition)}"')
+ lines.append(f'definition = "{PipelexInterpreter.escape_plx_string(concept.definition)}"')
if concept.refines:
- lines.append(f'refines = "{PipelexInterpreter.escape_toml_string(concept.refines)}"')
+ lines.append(f'refines = "{PipelexInterpreter.escape_plx_string(concept.refines)}"')
if concept.structure:
if isinstance(concept.structure, str):
- lines.append(f'structure = "{PipelexInterpreter.escape_toml_string(concept.structure)}"')
+ lines.append(f'structure = "{PipelexInterpreter.escape_plx_string(concept.structure)}"')
else:
# Complex structure with fields
lines.append("")
lines.append(f"[concept.{concept_name}.structure]")
for field_name, field_def in concept.structure.items():
- field_toml = PipelexInterpreter.structure_field_to_toml_string(field_name, field_def)
- lines.append(field_toml)
+ field_plx = PipelexInterpreter.structure_field_to_plx_string(field_name, field_def)
+ lines.append(field_plx)
return "\n".join(lines)
@staticmethod
- def structure_field_to_toml_string(field_name: str, field_def: Any) -> str:
- """Convert a structure field to TOML string."""
+ def structure_field_to_plx_string(field_name: str, field_def: Any) -> str:
+ """Convert a structure field to PLX string."""
if isinstance(field_def, str):
- return f'{field_name} = "{PipelexInterpreter.escape_toml_string(field_def)}"'
+ return f'{field_name} = "{PipelexInterpreter.escape_plx_string(field_def)}"'
else:
# Complex field with type, definition, required, etc.
field_parts: list[str] = []
if hasattr(field_def, "type") and field_def.type:
type_value = field_def.type.value if hasattr(field_def.type, "value") else field_def.type
- field_parts.append(f'type = "{PipelexInterpreter.escape_toml_string(str(type_value))}"')
+ field_parts.append(f'type = "{PipelexInterpreter.escape_plx_string(str(type_value))}"')
if hasattr(field_def, "definition") and field_def.definition:
- field_parts.append(f'definition = "{PipelexInterpreter.escape_toml_string(field_def.definition)}"')
+ field_parts.append(f'definition = "{PipelexInterpreter.escape_plx_string(field_def.definition)}"')
if hasattr(field_def, "required") and field_def.required is not None:
field_parts.append(f"required = {str(field_def.required).lower()}")
@@ -250,54 +255,54 @@ class PipelexInterpreter(BaseModel):
return f"{field_name} = {{ {', '.join(field_parts)} }}"
@staticmethod
- def pipes_to_toml_string(pipes: Dict[str, Any], domain: str) -> str:
- """Convert pipes dict to TOML string."""
- toml_parts: list[str] = []
+ def pipes_to_plx_string(pipes: Dict[str, Any], domain: str) -> str:
+ """Convert pipes dict to PLX string."""
+ plx_parts: list[str] = []
for pipe_name, blueprint in pipes.items():
- pipe_toml = PipelexInterpreter.pipe_to_toml_string(pipe_name, blueprint, domain)
- toml_parts.append(pipe_toml)
- return "\n\n".join(toml_parts)
+ pipe_plx = PipelexInterpreter.pipe_to_plx_string(pipe_name, blueprint, domain)
+ plx_parts.append(pipe_plx)
+ return "\n\n".join(plx_parts)
@staticmethod
- def pipe_to_toml_string(pipe_name: str, blueprint: Any, domain: str) -> str:
- """Convert a single pipe blueprint to TOML string."""
+ def pipe_to_plx_string(pipe_name: str, blueprint: Any, domain: str) -> str:
+ """Convert a single pipe blueprint to PLX string."""
if isinstance(blueprint, PipeLLMBlueprint):
- return PipelexInterpreter.llm_pipe_to_toml_string(pipe_name, blueprint, domain)
+ return PipelexInterpreter.llm_pipe_to_plx_string(pipe_name, blueprint, domain)
elif isinstance(blueprint, PipeSequenceBlueprint):
- return PipelexInterpreter.sequence_pipe_to_toml_string(pipe_name, blueprint, domain)
+ return PipelexInterpreter.sequence_pipe_to_plx_string(pipe_name, blueprint, domain)
elif isinstance(blueprint, PipeOcrBlueprint):
- return PipelexInterpreter.ocr_pipe_to_toml_string(pipe_name, blueprint, domain)
+ return PipelexInterpreter.ocr_pipe_to_plx_string(pipe_name, blueprint, domain)
elif isinstance(blueprint, PipeFuncBlueprint):
- return PipelexInterpreter.func_pipe_to_toml_string(pipe_name, blueprint, domain)
+ return PipelexInterpreter.func_pipe_to_plx_string(pipe_name, blueprint, domain)
elif isinstance(blueprint, PipeImgGenBlueprint):
- return PipelexInterpreter.img_gen_pipe_to_toml_string(pipe_name, blueprint, domain)
+ return PipelexInterpreter.img_gen_pipe_to_plx_string(pipe_name, blueprint, domain)
elif isinstance(blueprint, PipeJinja2Blueprint):
- return PipelexInterpreter.jinja2_pipe_to_toml_string(pipe_name, blueprint, domain)
+ return PipelexInterpreter.jinja2_pipe_to_plx_string(pipe_name, blueprint, domain)
elif isinstance(blueprint, PipeConditionBlueprint):
- return PipelexInterpreter.condition_pipe_to_toml_string(pipe_name, blueprint, domain)
+ return PipelexInterpreter.condition_pipe_to_plx_string(pipe_name, blueprint, domain)
elif isinstance(blueprint, PipeParallelBlueprint):
- return PipelexInterpreter.parallel_pipe_to_toml_string(pipe_name, blueprint, domain)
+ return PipelexInterpreter.parallel_pipe_to_plx_string(pipe_name, blueprint, domain)
elif isinstance(blueprint, PipeBatchBlueprint):
- return PipelexInterpreter.batch_pipe_to_toml_string(pipe_name, blueprint, domain)
+ return PipelexInterpreter.batch_pipe_to_plx_string(pipe_name, blueprint, domain)
else:
# Fallback to old dict approach for unknown pipe types
pipe_dict = PipelexInterpreter.serialize_pipe(blueprint, domain)
return f"[pipe.{pipe_name}]\n" + "\n".join([f'{k} = "{v}"' if isinstance(v, str) else f"{k} = {v}" for k, v in pipe_dict.items()])
@staticmethod
- def llm_pipe_to_toml_string(pipe_name: str, pipe: PipeLLMBlueprint, domain: str) -> str:
- """Convert a PipeLLM blueprint directly to TOML section string."""
+ def llm_pipe_to_plx_string(pipe_name: str, pipe: PipeLLMBlueprint, domain: str) -> str:
+ """Convert a PipeLLM blueprint directly to PLX section string."""
lines: list[str] = [
f"[pipe.{pipe_name}]",
- f'type = "{PipelexInterpreter.escape_toml_string(pipe.type)}"',
- f'definition = "{PipelexInterpreter.escape_toml_string(pipe.definition)}"',
+ f'type = "{PipelexInterpreter.escape_plx_string(pipe.type)}"',
+ f'definition = "{PipelexInterpreter.escape_plx_string(pipe.definition)}"',
]
# Add inputs first if they exist
PipelexInterpreter.add_inputs_to_lines_if_exist(lines, pipe.inputs)
# Add output after inputs (or immediately if no inputs)
- lines.append(f'output = "{PipelexInterpreter.escape_toml_string(pipe.output_concept_string_or_concept_code)}"')
+ lines.append(f'output = "{PipelexInterpreter.escape_plx_string(pipe.output_concept_string_or_concept_code)}"')
# Add optional fields
if pipe.nb_output is not None:
@@ -305,21 +310,21 @@ class PipelexInterpreter(BaseModel):
if pipe.multiple_output is not None:
lines.append(f"multiple_output = {str(pipe.multiple_output).lower()}")
if pipe.system_prompt_template:
- lines.append(f'system_prompt_template = "{PipelexInterpreter.escape_toml_string(pipe.system_prompt_template)}"')
+ lines.append(f'system_prompt_template = "{PipelexInterpreter.escape_plx_string(pipe.system_prompt_template)}"')
if pipe.system_prompt:
- lines.append(f'system_prompt = "{PipelexInterpreter.escape_toml_string(pipe.system_prompt)}"')
+ lines.append(f'system_prompt = "{PipelexInterpreter.escape_plx_string(pipe.system_prompt)}"')
if pipe.prompt_template:
- lines.append(f'prompt_template = "{PipelexInterpreter.escape_toml_string(pipe.prompt_template)}"')
+ lines.append(f'prompt_template = "{PipelexInterpreter.escape_plx_string(pipe.prompt_template)}"')
if pipe.template_name:
- lines.append(f'template_name = "{PipelexInterpreter.escape_toml_string(pipe.template_name)}"')
+ lines.append(f'template_name = "{PipelexInterpreter.escape_plx_string(pipe.template_name)}"')
if pipe.prompt:
- lines.append(f'prompt = "{PipelexInterpreter.escape_toml_string(pipe.prompt)}"')
+ lines.append(f'prompt = "{PipelexInterpreter.escape_plx_string(pipe.prompt)}"')
return "\n".join(lines)
@staticmethod
- def ocr_pipe_to_toml_string(pipe_name: str, pipe: PipeOcrBlueprint, domain: str) -> str:
- """Convert a PipeOcr blueprint directly to TOML section string."""
+ def ocr_pipe_to_plx_string(pipe_name: str, pipe: PipeOcrBlueprint, domain: str) -> str:
+ """Convert a PipeOcr blueprint directly to PLX section string."""
lines: list[str] = [
f"[pipe.{pipe_name}]",
f'type = "{pipe.type}"',
@@ -329,13 +334,13 @@ class PipelexInterpreter(BaseModel):
# Add inputs if they exist
PipelexInterpreter.add_inputs_to_lines_if_exist(lines, pipe.inputs)
- lines.append(f'output = "{PipelexInterpreter.escape_toml_string(pipe.output_concept_string_or_concept_code)}"')
+ lines.append(f'output = "{PipelexInterpreter.escape_plx_string(pipe.output_concept_string_or_concept_code)}"')
return "\n".join(lines)
@staticmethod
- def func_pipe_to_toml_string(pipe_name: str, pipe: PipeFuncBlueprint, domain: str) -> str:
- """Convert a PipeFunc blueprint directly to TOML section string."""
+ def func_pipe_to_plx_string(pipe_name: str, pipe: PipeFuncBlueprint, domain: str) -> str:
+ """Convert a PipeFunc blueprint directly to PLX section string."""
lines: list[str] = [
f"[pipe.{pipe_name}]",
f'type = "{pipe.type}"',
@@ -345,14 +350,14 @@ class PipelexInterpreter(BaseModel):
# Add inputs if they exist
PipelexInterpreter.add_inputs_to_lines_if_exist(lines, pipe.inputs)
- lines.append(f'output = "{PipelexInterpreter.escape_toml_string(pipe.output_concept_string_or_concept_code)}"')
- lines.append(f'function_name = "{PipelexInterpreter.escape_toml_string(pipe.function_name)}"')
+ lines.append(f'output = "{PipelexInterpreter.escape_plx_string(pipe.output_concept_string_or_concept_code)}"')
+ lines.append(f'function_name = "{PipelexInterpreter.escape_plx_string(pipe.function_name)}"')
return "\n".join(lines)
@staticmethod
- def img_gen_pipe_to_toml_string(pipe_name: str, pipe: PipeImgGenBlueprint, domain: str) -> str:
- """Convert a PipeImgGen blueprint directly to TOML section string."""
+ def img_gen_pipe_to_plx_string(pipe_name: str, pipe: PipeImgGenBlueprint, domain: str) -> str:
+ """Convert a PipeImgGen blueprint directly to PLX section string."""
lines: list[str] = [
f"[pipe.{pipe_name}]",
f'type = "{pipe.type}"',
@@ -362,13 +367,13 @@ class PipelexInterpreter(BaseModel):
# Add inputs if they exist
PipelexInterpreter.add_inputs_to_lines_if_exist(lines, pipe.inputs)
- lines.append(f'output = "{PipelexInterpreter.escape_toml_string(pipe.output_concept_string_or_concept_code)}"')
+ lines.append(f'output = "{PipelexInterpreter.escape_plx_string(pipe.output_concept_string_or_concept_code)}"')
# Add optional fields
if pipe.img_gen_prompt:
- lines.append(f'img_gen_prompt = "{PipelexInterpreter.escape_toml_string(pipe.img_gen_prompt)}"')
+ lines.append(f'img_gen_prompt = "{PipelexInterpreter.escape_plx_string(pipe.img_gen_prompt)}"')
if pipe.imgg_handle:
- lines.append(f'imgg_handle = "{PipelexInterpreter.escape_toml_string(pipe.imgg_handle)}"')
+ lines.append(f'imgg_handle = "{PipelexInterpreter.escape_plx_string(pipe.imgg_handle)}"')
if pipe.aspect_ratio:
lines.append(f'aspect_ratio = "{pipe.aspect_ratio}"')
if pipe.quality:
@@ -391,8 +396,8 @@ class PipelexInterpreter(BaseModel):
return "\n".join(lines)
@staticmethod
- def jinja2_pipe_to_toml_string(pipe_name: str, pipe: PipeJinja2Blueprint, domain: str) -> str:
- """Convert a PipeJinja2 blueprint directly to TOML section string."""
+ def jinja2_pipe_to_plx_string(pipe_name: str, pipe: PipeJinja2Blueprint, domain: str) -> str:
+ """Convert a PipeJinja2 blueprint directly to PLX section string."""
lines: list[str] = [
f"[pipe.{pipe_name}]",
f'type = "{pipe.type}"',
@@ -402,19 +407,19 @@ class PipelexInterpreter(BaseModel):
# Add inputs if they exist
PipelexInterpreter.add_inputs_to_lines_if_exist(lines, pipe.inputs)
- lines.append(f'output = "{PipelexInterpreter.escape_toml_string(pipe.output_concept_string_or_concept_code)}"')
+ lines.append(f'output = "{PipelexInterpreter.escape_plx_string(pipe.output_concept_string_or_concept_code)}"')
# Add jinja2 template
if pipe.jinja2:
- lines.append(f'jinja2 = "{PipelexInterpreter.escape_toml_string(pipe.jinja2)}"')
+ lines.append(f'jinja2 = "{PipelexInterpreter.escape_plx_string(pipe.jinja2)}"')
if pipe.jinja2_name:
- lines.append(f'jinja2_name = "{PipelexInterpreter.escape_toml_string(pipe.jinja2_name)}"')
+ lines.append(f'jinja2_name = "{PipelexInterpreter.escape_plx_string(pipe.jinja2_name)}"')
return "\n".join(lines)
@staticmethod
- def condition_pipe_to_toml_string(pipe_name: str, pipe: PipeConditionBlueprint, domain: str) -> str:
- """Convert a PipeCondition blueprint directly to TOML section string."""
+ def condition_pipe_to_plx_string(pipe_name: str, pipe: PipeConditionBlueprint, domain: str) -> str:
+ """Convert a PipeCondition blueprint directly to PLX section string."""
lines: list[str] = [
f"[pipe.{pipe_name}]",
f'type = "{pipe.type}"',
@@ -424,7 +429,7 @@ class PipelexInterpreter(BaseModel):
# Add inputs if they exist
PipelexInterpreter.add_inputs_to_lines_if_exist(lines, pipe.inputs)
- lines.append(f'output = "{PipelexInterpreter.escape_toml_string(pipe.output_concept_string_or_concept_code)}"')
+ lines.append(f'output = "{PipelexInterpreter.escape_plx_string(pipe.output_concept_string_or_concept_code)}"')
# Add pipe_map
if pipe.pipe_map:
@@ -447,8 +452,8 @@ class PipelexInterpreter(BaseModel):
return "\n".join(lines)
@staticmethod
- def parallel_pipe_to_toml_string(pipe_name: str, pipe: PipeParallelBlueprint, domain: str) -> str:
- """Convert a PipeParallel blueprint directly to TOML section string."""
+ def parallel_pipe_to_plx_string(pipe_name: str, pipe: PipeParallelBlueprint, domain: str) -> str:
+ """Convert a PipeParallel blueprint directly to PLX section string."""
lines: list[str] = [
f"[pipe.{pipe_name}]",
f'type = "{pipe.type}"',
@@ -458,13 +463,13 @@ class PipelexInterpreter(BaseModel):
# Add inputs if they exist
PipelexInterpreter.add_inputs_to_lines_if_exist(lines, pipe.inputs)
- lines.append(f'output = "{PipelexInterpreter.escape_toml_string(pipe.output_concept_string_or_concept_code)}"')
+ lines.append(f'output = "{PipelexInterpreter.escape_plx_string(pipe.output_concept_string_or_concept_code)}"')
# Add parallels array
if pipe.parallels:
lines.append("parallels = [")
for parallel in pipe.parallels:
- parallel_string = PipelexInterpreter.sub_pipe_to_toml_string(parallel)
+ parallel_string = PipelexInterpreter.sub_pipe_to_plx_string(parallel)
lines.append(f" {parallel_string},")
lines.append("]")
@@ -477,8 +482,8 @@ class PipelexInterpreter(BaseModel):
return "\n".join(lines)
@staticmethod
- def batch_pipe_to_toml_string(pipe_name: str, pipe: PipeBatchBlueprint, domain: str) -> str:
- """Convert a PipeBatch blueprint directly to TOML section string."""
+ def batch_pipe_to_plx_string(pipe_name: str, pipe: PipeBatchBlueprint, domain: str) -> str:
+ """Convert a PipeBatch blueprint directly to PLX section string."""
lines: list[str] = [
f"[pipe.{pipe_name}]",
f'type = "{pipe.type}"',
@@ -488,7 +493,7 @@ class PipelexInterpreter(BaseModel):
# Add inputs if they exist
PipelexInterpreter.add_inputs_to_lines_if_exist(lines, pipe.inputs)
- lines.append(f'output = "{PipelexInterpreter.escape_toml_string(pipe.output_concept_string_or_concept_code)}"')
+ lines.append(f'output = "{PipelexInterpreter.escape_plx_string(pipe.output_concept_string_or_concept_code)}"')
lines.append(f'branch_pipe_code = "{pipe.branch_pipe_code}"')
# Add optional fields
@@ -816,8 +821,8 @@ class PipelexInterpreter(BaseModel):
return step_data
@staticmethod
- def sub_pipe_to_toml_string(sub_pipe: Any) -> str:
- """Convert a sub pipe blueprint directly to a TOML inline table string."""
+ def sub_pipe_to_plx_string(sub_pipe: Any) -> str:
+ """Convert a sub pipe blueprint directly to a PLX inline table string."""
parts = [f'pipe = "{sub_pipe.pipe}"', f'result = "{sub_pipe.result}"']
# Add optional fields if they have non-default values
@@ -852,8 +857,8 @@ class PipelexInterpreter(BaseModel):
return result
@staticmethod
- def sequence_pipe_to_toml_string(pipe_name: str, pipe: PipeSequenceBlueprint, domain: str) -> str:
- """Convert a PipeSequence blueprint directly to TOML section string."""
+ def sequence_pipe_to_plx_string(pipe_name: str, pipe: PipeSequenceBlueprint, domain: str) -> str:
+ """Convert a PipeSequence blueprint directly to PLX section string."""
lines: list[str] = [
f"[pipe.{pipe_name}]",
f'type = "{pipe.type}"',
@@ -871,7 +876,7 @@ class PipelexInterpreter(BaseModel):
if pipe.steps:
lines.append("steps = [")
for step in pipe.steps:
- step_string = PipelexInterpreter.sub_pipe_to_toml_string(step)
+ step_string = PipelexInterpreter.sub_pipe_to_plx_string(step)
lines.append(f" {step_string},")
lines.append("]")
@@ -942,7 +947,7 @@ class PipelexInterpreter(BaseModel):
@staticmethod
def serialize_input_requirement(input_req: InputRequirementBlueprint) -> Dict[str, Any]:
- """Serialize a single InputRequirementBlueprint to TOML format."""
+ """Serialize a single InputRequirementBlueprint to PLX format."""
result: Dict[str, Any] = {"concept": input_req.concept}
if input_req.multiplicity is not None:
result["multiplicity"] = input_req.multiplicity
@@ -950,7 +955,7 @@ class PipelexInterpreter(BaseModel):
@staticmethod
def serialize_inputs(inputs: Mapping[str, Union[str, InputRequirementBlueprint]]) -> Dict[str, Any]:
- """Convert InputRequirementBlueprint objects to proper TOML format for serialization."""
+ """Convert InputRequirementBlueprint objects to proper PLX format for serialization."""
result: Dict[str, Any] = {}
for key, value in inputs.items():
if isinstance(value, InputRequirementBlueprint):
@@ -961,8 +966,8 @@ class PipelexInterpreter(BaseModel):
return result
@staticmethod
- def inputs_to_toml_string(inputs: Mapping[str, Union[str, InputRequirementBlueprint]]) -> str:
- """Convert inputs dictionary to TOML string format."""
+ def inputs_to_plx_string(inputs: Mapping[str, Union[str, InputRequirementBlueprint]]) -> str:
+ """Convert inputs dictionary to PLX string format."""
inputs_dict = PipelexInterpreter.serialize_inputs(inputs)
inputs_parts: list[str] = []
@@ -973,23 +978,23 @@ class PipelexInterpreter(BaseModel):
nested_dict: Dict[str, Any] = value
for nested_key, nested_value in nested_dict.items():
if isinstance(nested_value, str):
- nested_parts.append(f'{nested_key} = "{PipelexInterpreter.escape_toml_string(nested_value)}"')
+ nested_parts.append(f'{nested_key} = "{PipelexInterpreter.escape_plx_string(nested_value)}"')
else:
nested_parts.append(f"{nested_key} = {str(nested_value).lower()}")
inputs_parts.append(f"{key} = {{ {', '.join(nested_parts)} }}")
else:
# Simple string value
if isinstance(value, str):
- inputs_parts.append(f'{key} = "{PipelexInterpreter.escape_toml_string(value)}"')
+ inputs_parts.append(f'{key} = "{PipelexInterpreter.escape_plx_string(value)}"')
else:
# Fallback for any other type
- inputs_parts.append(f'{key} = "{PipelexInterpreter.escape_toml_string(str(value))}"')
+ inputs_parts.append(f'{key} = "{PipelexInterpreter.escape_plx_string(str(value))}"')
return f"{{ {', '.join(inputs_parts)} }}"
@staticmethod
def add_inputs_to_lines_if_exist(lines: list[str], pipe_inputs: Optional[Mapping[str, Union[str, InputRequirementBlueprint]]]) -> None:
- """Add inputs line to TOML lines if inputs exist."""
+ """Add inputs line to PLX lines if inputs exist."""
if pipe_inputs:
inputs_dict = PipelexInterpreter.serialize_inputs(pipe_inputs)
inputs_parts: list[str] = []
@@ -999,13 +1004,13 @@ class PipelexInterpreter(BaseModel):
nested_dict: Dict[str, Any] = value
for nested_key, nested_value in nested_dict.items():
if isinstance(nested_value, str):
- nested_parts.append(f'{nested_key} = "{PipelexInterpreter.escape_toml_string(nested_value)}"')
+ nested_parts.append(f'{nested_key} = "{PipelexInterpreter.escape_plx_string(nested_value)}"')
else:
nested_parts.append(f"{nested_key} = {str(nested_value).lower()}")
inputs_parts.append(f"{key} = {{ {', '.join(nested_parts)} }}")
else:
if isinstance(value, str):
- inputs_parts.append(f'{key} = "{PipelexInterpreter.escape_toml_string(value)}"')
+ inputs_parts.append(f'{key} = "{PipelexInterpreter.escape_plx_string(value)}"')
else:
- inputs_parts.append(f'{key} = "{PipelexInterpreter.escape_toml_string(str(value))}"')
+ inputs_parts.append(f'{key} = "{PipelexInterpreter.escape_plx_string(str(value))}"')
lines.append(f"inputs = {{ {', '.join(inputs_parts)} }}")
diff --git a/pipelex/create/build_blueprint.py b/pipelex/create/build_blueprint.py
index 40c822bdd..8643fda34 100644
--- a/pipelex/create/build_blueprint.py
+++ b/pipelex/create/build_blueprint.py
@@ -38,8 +38,8 @@ async def do_build_blueprint(
output_path_base = output_path or "pipelex/libraries/pipelines/temp/gen_blueprint"
draft_path = f"{output_path_base}_draft.md"
save_text_to_path(text=pipeline_draft, path=draft_path, create_directory=True)
- rough_toml_path = f"{output_path_base}_rough.toml"
- save_text_to_path(text=PipelexInterpreter.make_toml_content(blueprint=blueprint), path=rough_toml_path)
+ rough_plx_path = f"{output_path_base}_rough.plx"
+ save_text_to_path(text=PipelexInterpreter.make_plx_content(blueprint=blueprint), path=rough_plx_path)
rough_json_path = f"{output_path_base}_rough.json"
save_as_json_to_path(object_to_save=blueprint, path=rough_json_path)
log.info(f"✅ Rough blueprint saved to '{output_path_base}'")
diff --git a/pipelex/create/draft_pipeline.py b/pipelex/create/draft_pipeline.py
index 7b10aec56..b5f5034ca 100644
--- a/pipelex/create/draft_pipeline.py
+++ b/pipelex/create/draft_pipeline.py
@@ -52,9 +52,9 @@ async def do_draft_pipeline(
draft = pipe_output.main_stuff_as(content_type=PipelineDraft)
pretty_print(draft, title="Pipeline Draft")
draft_dict = draft.smart_dump()
- pretty_print(dict_to_toml(data=draft_dict), title="Pipeline Draft (TOML)")
+ pretty_print(dict_to_toml(data=draft_dict), title="Pipeline Draft (PLX)")
# Save or display result
- output_path = output_path or "pipelex/libraries/pipelines/temp/generated_blueprint.toml"
+ output_path = output_path or "pipelex/libraries/pipelines/temp/generated_blueprint.plx"
save_toml_to_path(data=draft_dict, path=output_path)
typer.echo(f"✅ Blueprint saved to '{output_path}'")
diff --git a/pipelex/libraries/library_config.py b/pipelex/libraries/library_config.py
index eb10ec107..b4b5f016c 100644
--- a/pipelex/libraries/library_config.py
+++ b/pipelex/libraries/library_config.py
@@ -44,7 +44,7 @@ class LibraryConfig(ConfigModel):
@property
def failing_pipelines_file_paths(self) -> List[str]:
- return ["tests/test_pipelines/failing_pipelines.toml"]
+ return ["tests/test_pipelines/failing_pipelines.plx"]
def get_llm_deck_paths(self) -> List[str]:
llm_deck_paths = [str(path) for path in find_files_in_dir(dir_path=self.llm_deck_dir_path, pattern="*.toml", is_recursive=True)]
diff --git a/pipelex/libraries/library_manager.py b/pipelex/libraries/library_manager.py
index de9b400df..1651b462e 100644
--- a/pipelex/libraries/library_manager.py
+++ b/pipelex/libraries/library_manager.py
@@ -87,9 +87,9 @@ class LibraryManager(LibraryManagerAbstract):
self.pipe_library.validate_with_libraries()
self.domain_library.validate_with_libraries()
- def _validate_toml_files(self):
- """Validate all TOML files used by the library manager for formatting issues."""
- log.debug("LibraryManager validating TOML file formatting")
+ def _validate_plx_files(self):
+ """Validate all PLX files used by the library manager for formatting issues."""
+ log.debug("LibraryManager validating PLX file formatting")
# Validation of LLM deck paths
llm_deck_paths = self.library_config.get_llm_deck_paths()
@@ -98,8 +98,8 @@ class LibraryManager(LibraryManagerAbstract):
try:
validate_toml_file(llm_deck_path)
except TOMLValidationError as exc:
- log.error(f"TOML formatting issues in LLM deck file '{llm_deck_path}': {exc}")
- raise LibraryError(f"TOML validation failed for LLM deck file '{llm_deck_path}': {exc}") from exc
+ log.error(f"PLX formatting issues in LLM deck file '{llm_deck_path}': {exc}")
+ raise LibraryError(f"PLX validation failed for LLM deck file '{llm_deck_path}': {exc}") from exc
# Validation of template paths
template_paths = self.library_config.get_templates_paths()
@@ -108,8 +108,8 @@ class LibraryManager(LibraryManagerAbstract):
try:
validate_toml_file(template_path)
except TOMLValidationError as exc:
- log.error(f"TOML formatting issues in template file '{template_path}': {exc}")
- raise LibraryError(f"TOML validation failed for template file '{template_path}': {exc}") from exc
+ log.error(f"PLX formatting issues in template file '{template_path}': {exc}")
+ raise LibraryError(f"PLX validation failed for template file '{template_path}': {exc}") from exc
@override
def setup(self) -> None:
@@ -134,37 +134,37 @@ class LibraryManager(LibraryManagerAbstract):
library_dirs += [Path(self.library_config.test_pipelines_dir_path)]
return library_dirs
- def _get_pipelex_toml_files_from_dirs(self, dirs: List[Path]) -> List[Path]:
- """Get all valid Pipelex TOML files from the given directories."""
+ def _get_pipelex_plx_files_from_dirs(self, dirs: List[Path]) -> List[Path]:
+ """Get all valid Pipelex PLX files from the given directories."""
- all_toml_paths: List[Path] = []
+ all_plx_paths: List[Path] = []
for dir_path in dirs:
if not dir_path.exists():
raise LibraryError(f"Directory does not exist: {dir_path}")
# Find all TOML files in the directory
- toml_files = find_files_in_dir(
+ plx_files = find_files_in_dir(
dir_path=str(dir_path),
- pattern="*.toml",
+ pattern="*.plx",
is_recursive=True,
)
# Filter to only include valid Pipelex files
- for toml_file in toml_files:
- if PipelexInterpreter.is_pipelex_file(toml_file):
- all_toml_paths.append(toml_file)
+ for plx_file in plx_files:
+ if PipelexInterpreter.is_pipelex_file(plx_file):
+ all_plx_paths.append(plx_file)
else:
- log.debug(f"Skipping non-Pipelex TOML file: {toml_file}")
+ log.debug(f"Skipping non-Pipelex PLX file: {plx_file}")
- return all_toml_paths
+ return all_plx_paths
@override
- def load_from_file(self, toml_path: Path) -> None:
+ def load_from_file(self, plx_path: Path) -> None:
"""Load a single file - this method is kept for compatibility."""
- if not PipelexInterpreter.is_pipelex_file(toml_path):
- raise LibraryError(f"File is not a valid Pipelex TOML file: {toml_path}")
+ if not PipelexInterpreter.is_pipelex_file(plx_path):
+ raise LibraryError(f"File is not a valid Pipelex PLX file: {plx_path}")
- blueprint = PipelexInterpreter(file_path=toml_path).make_pipelex_bundle_blueprint()
+ blueprint = PipelexInterpreter(file_path=plx_path).make_pipelex_bundle_blueprint()
self.load_from_blueprint(blueprint)
@override
@@ -230,12 +230,12 @@ class LibraryManager(LibraryManagerAbstract):
@override
def load_libraries(self, library_dirs: Optional[List[Path]] = None, library_file_paths: Optional[List[Path]] = None) -> None:
dirs_to_use: List[Path] = self._get_pipeline_library_dirs()
- all_toml_paths: List[Path] = self._get_pipelex_toml_files_from_dirs(dirs_to_use)
+ all_plx_paths: List[Path] = self._get_pipelex_plx_files_from_dirs(dirs_to_use)
# Remove failing pipelines from the list
failing_pipelines_file_paths = get_config().pipelex.library_config.failing_pipelines_file_paths
failing_paths_set = {Path(fp) for fp in failing_pipelines_file_paths}
- all_toml_paths = [path for path in all_toml_paths if path not in failing_paths_set]
+ all_plx_paths = [path for path in all_plx_paths if path not in failing_paths_set]
if library_dirs is not None:
dirs_to_use = library_dirs
@@ -245,12 +245,12 @@ class LibraryManager(LibraryManagerAbstract):
ClassRegistryUtils.register_classes_in_folder(folder_path=str(library_dir))
if library_file_paths is not None:
- all_toml_paths = library_file_paths
+ all_plx_paths = library_file_paths
# Parse all blueprints first
blueprints: List[PipelexBundleBlueprint] = []
- for toml_file_path in all_toml_paths:
- blueprint = PipelexInterpreter(file_path=toml_file_path).make_pipelex_bundle_blueprint()
+ for plx_file_path in all_plx_paths:
+ blueprint = PipelexInterpreter(file_path=plx_file_path).make_pipelex_bundle_blueprint()
blueprints.append(blueprint)
# Load all domains first
diff --git a/pipelex/libraries/library_manager_abstract.py b/pipelex/libraries/library_manager_abstract.py
index b04f195e7..21cbd33bc 100644
--- a/pipelex/libraries/library_manager_abstract.py
+++ b/pipelex/libraries/library_manager_abstract.py
@@ -28,7 +28,7 @@ class LibraryManagerAbstract(ABC):
pass
@abstractmethod
- def load_from_file(self, toml_path: Path) -> None:
+ def load_from_file(self, plx_path: Path) -> None:
pass
@abstractmethod
diff --git a/pipelex/libraries/pipelines/documents.toml b/pipelex/libraries/pipelines/documents.plx
similarity index 100%
rename from pipelex/libraries/pipelines/documents.toml
rename to pipelex/libraries/pipelines/documents.plx
diff --git a/pipelex/libraries/pipelines/images.toml b/pipelex/libraries/pipelines/images.plx
similarity index 100%
rename from pipelex/libraries/pipelines/images.toml
rename to pipelex/libraries/pipelines/images.plx
diff --git a/pipelex/libraries/pipelines/meta/meta_pipeline.toml b/pipelex/libraries/pipelines/meta/meta_pipeline.plx
similarity index 100%
rename from pipelex/libraries/pipelines/meta/meta_pipeline.toml
rename to pipelex/libraries/pipelines/meta/meta_pipeline.plx
diff --git a/pipelex/libraries/pipelines/meta/pipeline_draft.py b/pipelex/libraries/pipelines/meta/pipeline_draft.py
index 162c08bd5..e2954da67 100644
--- a/pipelex/libraries/pipelines/meta/pipeline_draft.py
+++ b/pipelex/libraries/pipelines/meta/pipeline_draft.py
@@ -15,7 +15,7 @@ class PipeDraft(StructuredContent):
class PipelineDraft(StructuredContent):
- """Complete blueprint of a pipeline library TOML file."""
+ """Complete blueprint of a pipeline library PLX file."""
# Domain information (required)
domain: str
@@ -29,6 +29,6 @@ class PipelineDraft(StructuredContent):
class PipelexBundleBlueprint(PipelexBundleBlueprintBaseModel, StructuredContent):
- """Complete blueprint of a pipelex bundle TOML file."""
+ """Complete blueprint of a pipelex bundle PLX file."""
pass
diff --git a/pipelex/libraries/templates/base_templates.toml b/pipelex/libraries/templates/base_templates.toml
index fe3026d04..087d362da 100644
--- a/pipelex/libraries/templates/base_templates.toml
+++ b/pipelex/libraries/templates/base_templates.toml
@@ -1,5 +1,3 @@
-
-
[generic_prompts]
structure_from_preliminary_text_system = "You are a data modeling expert specialized in extracting structure from text."
diff --git a/pipelex/migration/migrate_v0_1_0_to_v0_2_0.py b/pipelex/migration/migrate_v0_1_0_to_v0_2_0.py
index b11e84fd7..0d536e3d4 100644
--- a/pipelex/migration/migrate_v0_1_0_to_v0_2_0.py
+++ b/pipelex/migration/migrate_v0_1_0_to_v0_2_0.py
@@ -8,7 +8,7 @@ from typing import Any, ClassVar, Dict, List, Match
from pipelex.migration.migration_result import MigrationResult
-class TomlMigrator:
+class TOMLMigrator:
"""Handles migration from Concept = to definition = and PipeClassName = to type/definition syntax in TOML files."""
# Known pipe class names based on the factory classes in the codebase
@@ -257,7 +257,7 @@ def migrate_concept_syntax(directory: Path, create_backups: bool = True, dry_run
Returns:
MigrationResult with migration statistics
"""
- migrator = TomlMigrator()
+ migrator = TOMLMigrator()
# Support passing a single TOML file path in addition to a directory
input_path = directory
diff --git a/pipelex/pipe_operators/llm/pipe_llm.py b/pipelex/pipe_operators/llm/pipe_llm.py
index 95bd71b36..dadbafd8a 100644
--- a/pipelex/pipe_operators/llm/pipe_llm.py
+++ b/pipelex/pipe_operators/llm/pipe_llm.py
@@ -297,7 +297,7 @@ class PipeLLM(PipeOperator):
# Append output structure prompt if needed
output_structure_prompt: Optional[str] = PipeLLM.get_output_structure_prompt(
concept_string=pipe_run_params.dynamic_output_concept_code or output_concept.concept_string,
- is_with_preliminary_text=is_with_preliminary_text or False,
+ is_with_preliminary_text=is_with_preliminary_text,
)
llm_prompt_run_params = PipeRunParams.copy_by_injecting_multiplicity(
@@ -345,7 +345,11 @@ class PipeLLM(PipeOperator):
pipe = get_required_pipe(pipe_code=self.code)
# TODO: run_pipe() could get the domain at the same time as the pip_code
domain = get_required_domain(domain=pipe.domain)
- prompt_template_to_structure = self.prompt_template_to_structure or domain.prompt_template_to_structure
+ prompt_template_to_structure = (
+ self.prompt_template_to_structure
+ or domain.prompt_template_to_structure
+ or get_template(template_name="structure_from_preliminary_text_user")
+ )
system_prompt = self.system_prompt_to_structure or domain.system_prompt
llm_prompt_2_proto = LLMPrompt(
system_text=system_prompt,
@@ -361,7 +365,11 @@ class PipeLLM(PipeOperator):
domain = get_required_domain(domain=the_pipe.domain)
else:
domain = Domain.make_default()
- prompt_template_to_structure = self.prompt_template_to_structure or domain.prompt_template_to_structure
+ prompt_template_to_structure = (
+ self.prompt_template_to_structure
+ or domain.prompt_template_to_structure
+ or get_template(template_name="structure_from_preliminary_text_user")
+ )
system_prompt = self.system_prompt_to_structure or domain.system_prompt
llm_prompt_2_proto = LLMPrompt(
system_text=system_prompt,
diff --git a/pyproject.toml b/pyproject.toml
index 5b6b78cad..5a67e0e50 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "pipelex"
-version = "0.8.1"
+version = "0.9.0"
description = "Pipelex is an open-source dev tool based on a simple declarative language that lets you define replicable, structured, composable LLM pipelines."
authors = [{ name = "Evotis S.A.S.", email = "[email protected]" }]
maintainers = [{ name = "Pipelex staff", email = "[email protected]" }]
diff --git a/tests/data/tools_data/problematic_test_cases.toml b/tests/data/tools_data/problematic_test_cases.plx
similarity index 100%
rename from tests/data/tools_data/problematic_test_cases.toml
rename to tests/data/tools_data/problematic_test_cases.plx
diff --git a/tests/integration/pipelex/pipes/controller/pipe_batch/test_pipe_batch_simple.py b/tests/integration/pipelex/pipes/controller/pipe_batch/test_pipe_batch_simple.py
index 3ef5c9643..af4eda584 100644
--- a/tests/integration/pipelex/pipes/controller/pipe_batch/test_pipe_batch_simple.py
+++ b/tests/integration/pipelex/pipes/controller/pipe_batch/test_pipe_batch_simple.py
@@ -28,7 +28,7 @@ class TestPipeBatchSimple:
async def test_simple_batch_processing(self, request: FixtureRequest, pipe_run_mode: PipeRunMode):
"""Test PipeBatch with a simple batch processing scenario."""
- # Create PipeBatch instance - it will call the uppercase_transformer pipe from the TOML
+ # Create PipeBatch instance - it will call the uppercase_transformer pipe from the PLX
domain = "test_integration"
concept_1 = ConceptFactory.make_from_blueprint(
concept_code="TestConcept1",
@@ -47,7 +47,7 @@ class TestPipeBatchSimple:
pipe_batch_blueprint = PipeBatchBlueprint(
definition="Simple batch processing test",
- branch_pipe_code="uppercase_transformer", # This exists in the TOML file
+ branch_pipe_code="uppercase_transformer", # This exists in the PLX file
inputs={
"text_list": InputRequirementBlueprint(concept=concept_1.concept_string),
"text_item": InputRequirementBlueprint(concept=concept_2.concept_string),
diff --git a/tests/integration/pipelex/pipes/controller/pipe_condition/test_pipe_condition_simple.py b/tests/integration/pipelex/pipes/controller/pipe_condition/test_pipe_condition_simple.py
index 4bb31f103..32088a1c7 100644
--- a/tests/integration/pipelex/pipes/controller/pipe_condition/test_pipe_condition_simple.py
+++ b/tests/integration/pipelex/pipes/controller/pipe_condition/test_pipe_condition_simple.py
@@ -106,7 +106,7 @@ class TestPipeConditionSimple:
async def test_condition_short_text_processing(self, request: FixtureRequest, pipe_run_mode: PipeRunMode):
"""Test PipeCondition with short text that should trigger add_prefix_short_text pipe."""
- # Create PipeCondition instance - pipes are loaded from TOML files
+ # Create PipeCondition instance - pipes are loaded from PLX files
pipe_condition_blueprint = PipeConditionBlueprint(
definition="Text length condition for short text testing",
inputs={"input_text": InputRequirementBlueprint(concept=f"{SpecialDomain.NATIVE.value}.{NativeConceptEnum.TEXT.value}")},
diff --git a/tests/integration/pipelex/pipes/controller/pipe_parallel/test_pipe_parallel_simple.py b/tests/integration/pipelex/pipes/controller/pipe_parallel/test_pipe_parallel_simple.py
index b309aa175..953330765 100644
--- a/tests/integration/pipelex/pipes/controller/pipe_parallel/test_pipe_parallel_simple.py
+++ b/tests/integration/pipelex/pipes/controller/pipe_parallel/test_pipe_parallel_simple.py
@@ -28,7 +28,7 @@ class TestPipeParallelSimple:
async def test_parallel_text_analysis(self, request: FixtureRequest, pipe_run_mode: PipeRunMode):
"""Test PipeParallel running three text analysis pipes in parallel."""
- # Create PipeParallel instance - pipes are loaded from TOML files
+ # Create PipeParallel instance - pipes are loaded from PLX files
pipe_parallel_blueprint = PipeParallelBlueprint(
definition="Parallel text analysis pipeline",
inputs={"input_text": InputRequirementBlueprint(concept=f"{SpecialDomain.NATIVE.value}.{NativeConceptEnum.TEXT.value}")},
diff --git a/tests/integration/pipelex/pipes/controller/pipe_sequence/test_pipe_sequence_simple.py b/tests/integration/pipelex/pipes/controller/pipe_sequence/test_pipe_sequence_simple.py
index 487f4c564..d75b00207 100644
--- a/tests/integration/pipelex/pipes/controller/pipe_sequence/test_pipe_sequence_simple.py
+++ b/tests/integration/pipelex/pipes/controller/pipe_sequence/test_pipe_sequence_simple.py
@@ -41,7 +41,7 @@ class TestPipeSequenceSimple:
concept_library.add_concepts([concept_1])
concept_2 = concept_library.get_native_concept(native_concept=NativeConceptEnum.TEXT)
- # Create PipeSequence instance - pipes are loaded from TOML files
+ # Create PipeSequence instance - pipes are loaded from PLX files
pipe_sequence_blueprint = PipeSequenceBlueprint(
definition="Simple sequence for text processing",
inputs={"input_text": InputRequirementBlueprint(concept=concept_1.concept_string)},
diff --git a/tests/test_pipelines/concept_library/is_compatible_concept_code.toml b/tests/test_pipelines/concept_library/is_compatible_concept_code.plx
similarity index 100%
rename from tests/test_pipelines/concept_library/is_compatible_concept_code.toml
rename to tests/test_pipelines/concept_library/is_compatible_concept_code.plx
diff --git a/tests/test_pipelines/datetime.toml b/tests/test_pipelines/datetime.plx
similarity index 100%
rename from tests/test_pipelines/datetime.toml
rename to tests/test_pipelines/datetime.plx
diff --git a/tests/test_pipelines/discord_newsletter.toml b/tests/test_pipelines/discord_newsletter.plx
similarity index 100%
rename from tests/test_pipelines/discord_newsletter.toml
rename to tests/test_pipelines/discord_newsletter.plx
diff --git a/tests/test_pipelines/failing_pipelines.toml b/tests/test_pipelines/failing_pipelines.plx
similarity index 100%
rename from tests/test_pipelines/failing_pipelines.toml
rename to tests/test_pipelines/failing_pipelines.plx
diff --git a/tests/test_pipelines/misc_tests/flows.toml b/tests/test_pipelines/misc_tests/flows.plx
similarity index 100%
rename from tests/test_pipelines/misc_tests/flows.toml
rename to tests/test_pipelines/misc_tests/flows.plx
diff --git a/tests/test_pipelines/misc_tests/multiplicity.toml b/tests/test_pipelines/misc_tests/multiplicity.plx
similarity index 100%
rename from tests/test_pipelines/misc_tests/multiplicity.toml
rename to tests/test_pipelines/misc_tests/multiplicity.plx
diff --git a/tests/test_pipelines/misc_tests/subfolder_1/cars.toml b/tests/test_pipelines/misc_tests/subfolder_1/cars.plx
similarity index 100%
rename from tests/test_pipelines/misc_tests/subfolder_1/cars.toml
rename to tests/test_pipelines/misc_tests/subfolder_1/cars.plx
diff --git a/tests/test_pipelines/misc_tests/subfolder_2/animals.toml b/tests/test_pipelines/misc_tests/subfolder_2/animals.plx
similarity index 100%
rename from tests/test_pipelines/misc_tests/subfolder_2/animals.toml
rename to tests/test_pipelines/misc_tests/subfolder_2/animals.plx
diff --git a/tests/test_pipelines/misc_tests/subfolder_2/subfolder/flowers.toml b/tests/test_pipelines/misc_tests/subfolder_2/subfolder/flowers.plx
similarity index 100%
rename from tests/test_pipelines/misc_tests/subfolder_2/subfolder/flowers.toml
rename to tests/test_pipelines/misc_tests/subfolder_2/subfolder/flowers.plx
diff --git a/tests/test_pipelines/misc_tests/test_image_inputs.toml b/tests/test_pipelines/misc_tests/test_image_inputs.plx
similarity index 100%
rename from tests/test_pipelines/misc_tests/test_image_inputs.toml
rename to tests/test_pipelines/misc_tests/test_image_inputs.plx
diff --git a/tests/test_pipelines/misc_tests/test_jinja2.toml b/tests/test_pipelines/misc_tests/test_jinja2.plx
similarity index 100%
rename from tests/test_pipelines/misc_tests/test_jinja2.toml
rename to tests/test_pipelines/misc_tests/test_jinja2.plx
diff --git a/tests/test_pipelines/misc_tests/tests.toml b/tests/test_pipelines/misc_tests/tests.plx
similarity index 100%
rename from tests/test_pipelines/misc_tests/tests.toml
rename to tests/test_pipelines/misc_tests/tests.plx
diff --git a/tests/test_pipelines/pipe_controllers/pipe_batch/uppercase_transformer.toml b/tests/test_pipelines/pipe_controllers/pipe_batch/uppercase_transformer.plx
similarity index 100%
rename from tests/test_pipelines/pipe_controllers/pipe_batch/uppercase_transformer.toml
rename to tests/test_pipelines/pipe_controllers/pipe_batch/uppercase_transformer.plx
diff --git a/tests/test_pipelines/pipe_controllers/pipe_condition/pipe_condition_1.toml b/tests/test_pipelines/pipe_controllers/pipe_condition/pipe_condition_1.plx
similarity index 100%
rename from tests/test_pipelines/pipe_controllers/pipe_condition/pipe_condition_1.toml
rename to tests/test_pipelines/pipe_controllers/pipe_condition/pipe_condition_1.plx
diff --git a/tests/test_pipelines/pipe_controllers/pipe_condition/pipe_condition_2.toml b/tests/test_pipelines/pipe_controllers/pipe_condition/pipe_condition_2.plx
similarity index 100%
rename from tests/test_pipelines/pipe_controllers/pipe_condition/pipe_condition_2.toml
rename to tests/test_pipelines/pipe_controllers/pipe_condition/pipe_condition_2.plx
diff --git a/tests/test_pipelines/pipe_controllers/pipe_condition/pipe_condition_complex.toml b/tests/test_pipelines/pipe_controllers/pipe_condition/pipe_condition_complex.plx
similarity index 100%
rename from tests/test_pipelines/pipe_controllers/pipe_condition/pipe_condition_complex.toml
rename to tests/test_pipelines/pipe_controllers/pipe_condition/pipe_condition_complex.plx
diff --git a/tests/test_pipelines/pipe_controllers/pipe_condition/text_length_condition.toml b/tests/test_pipelines/pipe_controllers/pipe_condition/text_length_condition.plx
similarity index 100%
rename from tests/test_pipelines/pipe_controllers/pipe_condition/text_length_condition.toml
rename to tests/test_pipelines/pipe_controllers/pipe_condition/text_length_condition.plx
diff --git a/tests/test_pipelines/pipe_controllers/pipe_parallel/parallel_text_analysis.toml b/tests/test_pipelines/pipe_controllers/pipe_parallel/parallel_text_analysis.plx
similarity index 100%
rename from tests/test_pipelines/pipe_controllers/pipe_parallel/parallel_text_analysis.toml
rename to tests/test_pipelines/pipe_controllers/pipe_parallel/parallel_text_analysis.plx
diff --git a/tests/test_pipelines/pipe_controllers/pipe_parallel/pipe_parallel_1.toml b/tests/test_pipelines/pipe_controllers/pipe_parallel/pipe_parallel_1.plx
similarity index 100%
rename from tests/test_pipelines/pipe_controllers/pipe_parallel/pipe_parallel_1.toml
rename to tests/test_pipelines/pipe_controllers/pipe_parallel/pipe_parallel_1.plx
diff --git a/tests/test_pipelines/pipe_controllers/pipe_sequence/capitalize_text.toml b/tests/test_pipelines/pipe_controllers/pipe_sequence/capitalize_text.plx
similarity index 100%
rename from tests/test_pipelines/pipe_controllers/pipe_sequence/capitalize_text.toml
rename to tests/test_pipelines/pipe_controllers/pipe_sequence/capitalize_text.plx
diff --git a/tests/test_pipelines/pipe_controllers/pipe_sequence/pipe_sequence_1.toml b/tests/test_pipelines/pipe_controllers/pipe_sequence/pipe_sequence_1.plx
similarity index 100%
rename from tests/test_pipelines/pipe_controllers/pipe_sequence/pipe_sequence_1.toml
rename to tests/test_pipelines/pipe_controllers/pipe_sequence/pipe_sequence_1.plx
diff --git a/tests/test_pipelines/pipe_controllers/pipe_sequence/pipe_sequence_2.toml b/tests/test_pipelines/pipe_controllers/pipe_sequence/pipe_sequence_2.plx
similarity index 100%
rename from tests/test_pipelines/pipe_controllers/pipe_sequence/pipe_sequence_2.toml
rename to tests/test_pipelines/pipe_controllers/pipe_sequence/pipe_sequence_2.plx
diff --git a/tests/test_pipelines/pipe_controllers/pipe_sequence/pipe_sequence_3.toml b/tests/test_pipelines/pipe_controllers/pipe_sequence/pipe_sequence_3.plx
similarity index 100%
rename from tests/test_pipelines/pipe_controllers/pipe_sequence/pipe_sequence_3.toml
rename to tests/test_pipelines/pipe_controllers/pipe_sequence/pipe_sequence_3.plx
diff --git a/tests/test_pipelines/test.toml b/tests/test_pipelines/test.plx
similarity index 100%
rename from tests/test_pipelines/test.toml
rename to tests/test_pipelines/test.plx
diff --git a/tests/test_pipelines/test_tweet.toml b/tests/test_pipelines/test_tweet.plx
similarity index 100%
rename from tests/test_pipelines/test_tweet.toml
rename to tests/test_pipelines/test_tweet.plx
diff --git a/tests/test_pipelines/tricky_questions.toml b/tests/test_pipelines/tricky_questions.plx
similarity index 100%
rename from tests/test_pipelines/tricky_questions.toml
rename to tests/test_pipelines/tricky_questions.plx
diff --git a/tests/unit/pipelex/core/interpreter/test_interpreter.py b/tests/unit/pipelex/core/interpreter/test_interpreter.py
index fbc2bfe3e..ce0a1e95b 100644
--- a/tests/unit/pipelex/core/interpreter/test_interpreter.py
+++ b/tests/unit/pipelex/core/interpreter/test_interpreter.py
@@ -9,11 +9,11 @@ from tests.unit.pipelex.core.test_data import InterpreterTestCases
class TestPipelexInterpreter:
- """Test the PipelexInterpreter class with various TOML configurations."""
+ """Test the PipelexInterpreter class with various PLX configurations."""
def test_init_with_both_file_path_and_content(self, tmp_path: Path):
"""Test initialization with both file_path and file_content."""
- test_file = tmp_path / "test.toml"
+ test_file = tmp_path / "test.plx"
test_file.write_text("domain = 'test'\n[concept]\n")
content = "domain = 'other'\n[concept]\n"
@@ -21,10 +21,10 @@ class TestPipelexInterpreter:
assert converter.file_path == test_file
assert converter.file_content == content
- @pytest.mark.parametrize("test_name,toml_content,expected_blueprint", InterpreterTestCases.VALID_TEST_CASES)
- def test_make_pipelex_bundle_blueprint(self, test_name: str, toml_content: str, expected_blueprint: PipelexBundleBlueprint):
- """Test making blueprint from various valid TOML content."""
- converter = PipelexInterpreter(file_content=toml_content)
+ @pytest.mark.parametrize("test_name,plx_content,expected_blueprint", InterpreterTestCases.VALID_TEST_CASES)
+ def test_make_pipelex_bundle_blueprint(self, test_name: str, plx_content: str, expected_blueprint: PipelexBundleBlueprint):
+ """Test making blueprint from various valid PLX content."""
+ converter = PipelexInterpreter(file_content=plx_content)
from pipelex import pretty_print
blueprint = converter.make_pipelex_bundle_blueprint()
@@ -32,20 +32,20 @@ class TestPipelexInterpreter:
pretty_print(expected_blueprint, title=f"Expected blueprint {test_name}")
assert blueprint == expected_blueprint
- @pytest.mark.parametrize("test_name,toml_content,expected_blueprint", InterpreterTestCases.VALID_TEST_CASES)
- def test_make_toml_content(self, test_name: str, toml_content: str, expected_blueprint: PipelexBundleBlueprint):
- """Test making blueprint from various valid TOML content."""
- get_toml_content = PipelexInterpreter.make_toml_content(blueprint=expected_blueprint)
+ @pytest.mark.parametrize("test_name,plx_content,expected_blueprint", InterpreterTestCases.VALID_TEST_CASES)
+ def test_make_plx_content(self, test_name: str, plx_content: str, expected_blueprint: PipelexBundleBlueprint):
+ """Test making blueprint from various valid PLX content."""
+ get_plx_content = PipelexInterpreter.make_plx_content(blueprint=expected_blueprint)
from pipelex import pretty_print
- pretty_print(get_toml_content, title=f"TOML content {test_name}")
- pretty_print(toml_content, title=f"Expected TOML content {test_name}")
- assert get_toml_content == toml_content
+ pretty_print(get_plx_content, title=f"PLx content {test_name}")
+ pretty_print(plx_content, title=f"Expected PLX content {test_name}")
+ assert get_plx_content == plx_content
- @pytest.mark.parametrize("test_name,invalid_toml_content,expected_exception", InterpreterTestCases.ERROR_TEST_CASES)
- def test_invalid_toml_should_raise_exception(self, test_name: str, invalid_toml_content: str, expected_exception: Type[Exception]):
- """Test that invalid TOML content raises appropriate exceptions."""
- converter = PipelexInterpreter(file_content=invalid_toml_content)
+ @pytest.mark.parametrize("test_name,invalid_plx_content,expected_exception", InterpreterTestCases.ERROR_TEST_CASES)
+ def test_invalid_plx_should_raise_exception(self, test_name: str, invalid_plx_content: str, expected_exception: Type[Exception]):
+ """Test that invalid PLX content raises appropriate exceptions."""
+ converter = PipelexInterpreter(file_content=invalid_plx_content)
with pytest.raises(expected_exception):
converter.make_pipelex_bundle_blueprint()
diff --git a/tests/unit/pipelex/core/interpreter/test_pipelex_interpreter_batch_toml.py b/tests/unit/pipelex/core/interpreter/test_pipelex_interpreter_batch_plx.py
similarity index 74%
rename from tests/unit/pipelex/core/interpreter/test_pipelex_interpreter_batch_toml.py
rename to tests/unit/pipelex/core/interpreter/test_pipelex_interpreter_batch_plx.py
index a3de6c774..f8c27a00c 100644
--- a/tests/unit/pipelex/core/interpreter/test_pipelex_interpreter_batch_toml.py
+++ b/tests/unit/pipelex/core/interpreter/test_pipelex_interpreter_batch_plx.py
@@ -1,16 +1,14 @@
-"""Test PipelexInterpreter Batch pipe to TOML string conversion."""
-
import pytest
from pipelex.core.interpreter import PipelexInterpreter
from pipelex.pipe_controllers.batch.pipe_batch_blueprint import PipeBatchBlueprint
-class TestPipelexInterpreterBatchToml:
- """Test Batch pipe to TOML string conversion."""
+class TestPipelexInterpreterBatchPLX:
+ """Test Batch pipe to PLX string conversion."""
@pytest.mark.parametrize(
- "pipe_name,blueprint,expected_toml",
+ "pipe_name,blueprint,expected_plx",
[
# Basic Batch pipe
(
@@ -50,7 +48,7 @@ branch_pipe_code = "transform_item\"""",
),
],
)
- def test_batch_pipe_to_toml_string(self, pipe_name: str, blueprint: PipeBatchBlueprint, expected_toml: str):
- """Test converting Batch pipe blueprint to TOML string."""
- result = PipelexInterpreter.batch_pipe_to_toml_string(pipe_name, blueprint, "test_domain")
- assert result == expected_toml
+ def test_batch_pipe_to_plx_string(self, pipe_name: str, blueprint: PipeBatchBlueprint, expected_plx: str):
+ """Test converting Batch pipe blueprint to PLX string."""
+ result = PipelexInterpreter.batch_pipe_to_plx_string(pipe_name, blueprint, "test_domain")
+ assert result == expected_plx
diff --git a/tests/unit/pipelex/core/interpreter/test_pipelex_interpreter_concept_toml.py b/tests/unit/pipelex/core/interpreter/test_pipelex_interpreter_concept_plx.py
similarity index 88%
rename from tests/unit/pipelex/core/interpreter/test_pipelex_interpreter_concept_toml.py
rename to tests/unit/pipelex/core/interpreter/test_pipelex_interpreter_concept_plx.py
index a116259f3..5aec6a2a3 100644
--- a/tests/unit/pipelex/core/interpreter/test_pipelex_interpreter_concept_toml.py
+++ b/tests/unit/pipelex/core/interpreter/test_pipelex_interpreter_concept_plx.py
@@ -1,16 +1,14 @@
-"""Test PipelexInterpreter concept to TOML string conversion."""
-
import pytest
from pipelex.core.concepts.concept_blueprint import ConceptBlueprint, ConceptStructureBlueprint, ConceptStructureBlueprintFieldType
from pipelex.core.interpreter import PipelexInterpreter
-class TestPipelexInterpreterConceptToml:
- """Test concept to TOML string conversion."""
+class TestPipelexInterpreterConceptPLX:
+ """Test concept to PLX string conversion."""
@pytest.mark.parametrize(
- "concepts,expected_toml",
+ "concepts,expected_plx",
[
# Simple string concepts
(
@@ -93,7 +91,7 @@ structure = "ProductStructure\"""",
),
],
)
- def test_concepts_to_toml_string(self, concepts: dict[str, ConceptBlueprint | str], expected_toml: str):
- """Test converting concepts dict to TOML string."""
- result = PipelexInterpreter.concepts_to_toml_string(concepts, "test_domain")
- assert result == expected_toml
+ def test_concepts_to_plx_string(self, concepts: dict[str, ConceptBlueprint | str], expected_plx: str):
+ """Test converting concepts dict to PLX string."""
+ result = PipelexInterpreter.concepts_to_plx_string(concepts, "test_domain")
+ assert result == expected_plx
diff --git a/tests/unit/pipelex/core/interpreter/test_pipelex_interpreter_condition_toml.py b/tests/unit/pipelex/core/interpreter/test_pipelex_interpreter_condition_plx.py
similarity index 78%
rename from tests/unit/pipelex/core/interpreter/test_pipelex_interpreter_condition_toml.py
rename to tests/unit/pipelex/core/interpreter/test_pipelex_interpreter_condition_plx.py
index e6c9f06ba..216a8de5c 100644
--- a/tests/unit/pipelex/core/interpreter/test_pipelex_interpreter_condition_toml.py
+++ b/tests/unit/pipelex/core/interpreter/test_pipelex_interpreter_condition_plx.py
@@ -1,16 +1,14 @@
-"""Test PipelexInterpreter Condition pipe to TOML string conversion."""
-
import pytest
from pipelex.core.interpreter import PipelexInterpreter
from pipelex.pipe_controllers.condition.pipe_condition_blueprint import PipeConditionBlueprint, PipeConditionPipeMapBlueprint
-class TestPipelexInterpreterConditionToml:
- """Test Condition pipe to TOML string conversion."""
+class TestPipelexInterpreterConditionPLX:
+ """Test Condition pipe to PLX string conversion."""
@pytest.mark.parametrize(
- "pipe_name,blueprint,expected_toml",
+ "pipe_name,blueprint,expected_plx",
[
# Basic Condition pipe with expression
(
@@ -50,7 +48,7 @@ expression_template = "{{ data.size if data.size > threshold else 'low' }}\"""",
),
],
)
- def test_condition_pipe_to_toml_string(self, pipe_name: str, blueprint: PipeConditionBlueprint, expected_toml: str):
- """Test converting Condition pipe blueprint to TOML string."""
- result = PipelexInterpreter.condition_pipe_to_toml_string(pipe_name, blueprint, "test_domain")
- assert result == expected_toml
+ def test_condition_pipe_to_plx_string(self, pipe_name: str, blueprint: PipeConditionBlueprint, expected_plx: str):
+ """Test converting Condition pipe blueprint to PLX string."""
+ result = PipelexInterpreter.condition_pipe_to_plx_string(pipe_name, blueprint, "test_domain")
+ assert result == expected_plx
diff --git a/tests/unit/pipelex/core/interpreter/test_pipelex_interpreter_func_toml.py b/tests/unit/pipelex/core/interpreter/test_pipelex_interpreter_func_plx.py
similarity index 72%
rename from tests/unit/pipelex/core/interpreter/test_pipelex_interpreter_func_toml.py
rename to tests/unit/pipelex/core/interpreter/test_pipelex_interpreter_func_plx.py
index 0b2d3f1b6..38e2cdb8f 100644
--- a/tests/unit/pipelex/core/interpreter/test_pipelex_interpreter_func_toml.py
+++ b/tests/unit/pipelex/core/interpreter/test_pipelex_interpreter_func_plx.py
@@ -1,16 +1,14 @@
-"""Test PipelexInterpreter Func pipe to TOML string conversion."""
-
import pytest
from pipelex.core.interpreter import PipelexInterpreter
from pipelex.pipe_operators.func.pipe_func_blueprint import PipeFuncBlueprint
-class TestPipelexInterpreterFuncToml:
- """Test Func pipe to TOML string conversion."""
+class TestPipelexInterpreterFuncPLX:
+ """Test Func pipe to PLX string conversion."""
@pytest.mark.parametrize(
- "pipe_name,blueprint,expected_toml",
+ "pipe_name,blueprint,expected_plx",
[
# Basic Func pipe
(
@@ -46,7 +44,7 @@ function_name = "transform_function\"""",
),
],
)
- def test_func_pipe_to_toml_string(self, pipe_name: str, blueprint: PipeFuncBlueprint, expected_toml: str):
- """Test converting Func pipe blueprint to TOML string."""
- result = PipelexInterpreter.func_pipe_to_toml_string(pipe_name, blueprint, "test_domain")
- assert result == expected_toml
+ def test_func_pipe_to_plx_string(self, pipe_name: str, blueprint: PipeFuncBlueprint, expected_plx: str):
+ """Test converting Func pipe blueprint to PLX string."""
+ result = PipelexInterpreter.func_pipe_to_plx_string(pipe_name, blueprint, "test_domain")
+ assert result == expected_plx
diff --git a/tests/unit/pipelex/core/interpreter/test_pipelex_interpreter_img_gen_toml.py b/tests/unit/pipelex/core/interpreter/test_pipelex_interpreter_img_gen_plx.py
similarity index 73%
rename from tests/unit/pipelex/core/interpreter/test_pipelex_interpreter_img_gen_toml.py
rename to tests/unit/pipelex/core/interpreter/test_pipelex_interpreter_img_gen_plx.py
index fd8b46be6..b20b3f539 100644
--- a/tests/unit/pipelex/core/interpreter/test_pipelex_interpreter_img_gen_toml.py
+++ b/tests/unit/pipelex/core/interpreter/test_pipelex_interpreter_img_gen_plx.py
@@ -1,5 +1,3 @@
-"""Test PipelexInterpreter ImgGen pipe to TOML string conversion."""
-
import pytest
from pipelex.cogt.imgg.imgg_job_components import AspectRatio
@@ -7,11 +5,11 @@ from pipelex.core.interpreter import PipelexInterpreter
from pipelex.pipe_operators.img_gen.pipe_img_gen_blueprint import PipeImgGenBlueprint
-class TestPipelexInterpreterImgGenToml:
- """Test ImgGen pipe to TOML string conversion."""
+class TestPipelexInterpreterImgGenPLX:
+ """Test ImgGen pipe to PLX string conversion."""
@pytest.mark.parametrize(
- "pipe_name,blueprint,expected_toml",
+ "pipe_name,blueprint,expected_plx",
[
# Basic ImgGen pipe
(
@@ -49,7 +47,7 @@ seed = 12345""",
),
],
)
- def test_img_gen_pipe_to_toml_string(self, pipe_name: str, blueprint: PipeImgGenBlueprint, expected_toml: str):
- """Test converting ImgGen pipe blueprint to TOML string."""
- result = PipelexInterpreter.img_gen_pipe_to_toml_string(pipe_name, blueprint, "test_domain")
- assert result == expected_toml
+ def test_img_gen_pipe_to_plx_string(self, pipe_name: str, blueprint: PipeImgGenBlueprint, expected_plx: str):
+ """Test converting ImgGen pipe blueprint to PLX string."""
+ result = PipelexInterpreter.img_gen_pipe_to_plx_string(pipe_name, blueprint, "test_domain")
+ assert result == expected_plx
diff --git a/tests/unit/pipelex/core/interpreter/test_pipelex_interpreter_input_spec.py b/tests/unit/pipelex/core/interpreter/test_pipelex_interpreter_input_spec.py
index 5c2035506..daa048a48 100644
--- a/tests/unit/pipelex/core/interpreter/test_pipelex_interpreter_input_spec.py
+++ b/tests/unit/pipelex/core/interpreter/test_pipelex_interpreter_input_spec.py
@@ -1,5 +1,3 @@
-"""Test PipelexInterpreter input serialization for the two main cases."""
-
from typing import Any
import pytest
@@ -11,18 +9,18 @@ from pipelex.core.pipes.pipe_input_spec_blueprint import InputRequirementBluepri
class TestPipelexInterpreterInputSpec:
"""Test input serialization for both simple strings and InputRequirementBlueprint objects."""
- def test_inputs_to_toml_string_simple_strings(self):
- """Test converting simple string inputs to TOML format like { text = "Text", topic = "Text" }."""
+ def test_inputs_to_plx_string_simple_strings(self):
+ """Test converting simple string inputs to PLX format like { text = "Text", topic = "Text" }."""
# Simple string inputs (like "Text")
simple_inputs = {"text": "Text", "topic": "Text"}
- result = PipelexInterpreter.inputs_to_toml_string(simple_inputs)
+ result = PipelexInterpreter.inputs_to_plx_string(simple_inputs)
expected = '{ text = "Text", topic = "Text" }'
assert result == expected
- def test_inputs_to_toml_string_input_requirement_blueprints(self):
- """Test converting InputRequirementBlueprint inputs to TOML format like { text = { concept = "Text", multiplicity = 1 } }."""
+ def test_inputs_to_plx_string_input_requirement_blueprints(self):
+ """Test converting InputRequirementBlueprint inputs to PLX format like { text = { concept = "Text", multiplicity = 1 } }."""
# InputRequirementBlueprint inputs
complex_inputs = {
"text": InputRequirementBlueprint(concept="Text", multiplicity=1),
@@ -31,7 +29,7 @@ class TestPipelexInterpreterInputSpec:
"query": InputRequirementBlueprint(concept="Text", multiplicity=False),
}
- result = PipelexInterpreter.inputs_to_toml_string(complex_inputs)
+ result = PipelexInterpreter.inputs_to_plx_string(complex_inputs)
expected = (
'{ text = { concept = "Text", multiplicity = 1 }, problem = { concept = "Text" }, '
diff --git a/tests/unit/pipelex/core/interpreter/test_pipelex_interpreter_jinja2_toml.py b/tests/unit/pipelex/core/interpreter/test_pipelex_interpreter_jinja2_plx.py
similarity index 71%
rename from tests/unit/pipelex/core/interpreter/test_pipelex_interpreter_jinja2_toml.py
rename to tests/unit/pipelex/core/interpreter/test_pipelex_interpreter_jinja2_plx.py
index 0b21babf0..290efeb5f 100644
--- a/tests/unit/pipelex/core/interpreter/test_pipelex_interpreter_jinja2_toml.py
+++ b/tests/unit/pipelex/core/interpreter/test_pipelex_interpreter_jinja2_plx.py
@@ -1,16 +1,14 @@
-"""Test PipelexInterpreter Jinja2 pipe to TOML string conversion."""
-
import pytest
from pipelex.core.interpreter import PipelexInterpreter
from pipelex.pipe_operators.jinja2.pipe_jinja2_blueprint import PipeJinja2Blueprint
-class TestPipelexInterpreterJinja2Toml:
- """Test Jinja2 pipe to TOML string conversion."""
+class TestPipelexInterpreterJinja2PLX:
+ """Test Jinja2 pipe to PLX string conversion."""
@pytest.mark.parametrize(
- "pipe_name,blueprint,expected_toml",
+ "pipe_name,blueprint,expected_plx",
[
# Basic Jinja2 pipe
(
@@ -46,7 +44,7 @@ jinja2_name = "data_formatter\"""",
),
],
)
- def test_jinja2_pipe_to_toml_string(self, pipe_name: str, blueprint: PipeJinja2Blueprint, expected_toml: str):
- """Test converting Jinja2 pipe blueprint to TOML string."""
- result = PipelexInterpreter.jinja2_pipe_to_toml_string(pipe_name, blueprint, "test_domain")
- assert result == expected_toml
+ def test_jinja2_pipe_to_plx_string(self, pipe_name: str, blueprint: PipeJinja2Blueprint, expected_plx: str):
+ """Test converting Jinja2 pipe blueprint to PLX string."""
+ result = PipelexInterpreter.jinja2_pipe_to_plx_string(pipe_name, blueprint, "test_domain")
+ assert result == expected_plx
diff --git a/tests/unit/pipelex/core/interpreter/test_pipelex_interpreter_jinja2_spacing.py b/tests/unit/pipelex/core/interpreter/test_pipelex_interpreter_jinja2_spacing.py
index 0c7723c48..15e1b9d8c 100644
--- a/tests/unit/pipelex/core/interpreter/test_pipelex_interpreter_jinja2_spacing.py
+++ b/tests/unit/pipelex/core/interpreter/test_pipelex_interpreter_jinja2_spacing.py
@@ -1,16 +1,14 @@
-"""Test PipelexInterpreter jinja2_pipe_to_toml_string function."""
-
import pytest
from pipelex.core.interpreter import PipelexInterpreter
from pipelex.pipe_operators.jinja2.pipe_jinja2_blueprint import PipeJinja2Blueprint
-class TestPipelexInterpreterJinja2PipeTomlString:
- """Test the jinja2_pipe_to_toml_string function directly."""
+class TestPipelexInterpreterJinja2PipePLX:
+ """Test the jinja2_pipe_to_plx_string function directly."""
@pytest.mark.parametrize(
- "pipe_name,blueprint,expected_result",
+ "pipe_name,blueprint,expected_plx",
[
# Basic Jinja2 pipe
(
@@ -76,7 +74,7 @@ jinja2_name = "greeting_template\"""",
),
],
)
- def test_jinja2_pipe_to_toml_string(self, pipe_name: str, blueprint: PipeJinja2Blueprint, expected_result: str):
- """Test converting PipeJinja2Blueprint to TOML string with various configurations."""
- result = PipelexInterpreter.jinja2_pipe_to_toml_string(pipe_name, blueprint, "test_domain")
- assert result == expected_result
+ def test_jinja2_pipe_to_plx_string(self, pipe_name: str, blueprint: PipeJinja2Blueprint, expected_plx: str):
+ """Test converting PipeJinja2Blueprint to PLX string with various configurations."""
+ result = PipelexInterpreter.jinja2_pipe_to_plx_string(pipe_name, blueprint, "test_domain")
+ assert result == expected_plx
diff --git a/tests/unit/pipelex/core/interpreter/test_pipelex_interpreter_llm_toml.py b/tests/unit/pipelex/core/interpreter/test_pipelex_interpreter_llm_plx.py
similarity index 87%
rename from tests/unit/pipelex/core/interpreter/test_pipelex_interpreter_llm_toml.py
rename to tests/unit/pipelex/core/interpreter/test_pipelex_interpreter_llm_plx.py
index 444696e20..d7c2822cc 100644
--- a/tests/unit/pipelex/core/interpreter/test_pipelex_interpreter_llm_toml.py
+++ b/tests/unit/pipelex/core/interpreter/test_pipelex_interpreter_llm_plx.py
@@ -1,5 +1,3 @@
-"""Test PipelexInterpreter LLM pipe to TOML string conversion."""
-
import pytest
from pipelex.core.interpreter import PipelexInterpreter
@@ -7,11 +5,11 @@ from pipelex.core.pipes.pipe_input_spec_blueprint import InputRequirementBluepri
from pipelex.pipe_operators.llm.pipe_llm_blueprint import PipeLLMBlueprint
-class TestPipelexInterpreterLlmToml:
- """Test LLM pipe to TOML string conversion."""
+class TestPipelexInterpreterLLMPLX:
+ """Test LLM pipe to PLX string conversion."""
@pytest.mark.parametrize(
- "pipe_name,blueprint,expected_toml",
+ "pipe_name,blueprint,expected_plx",
[
# Simple LLM pipe with string inputs
(
@@ -90,7 +88,7 @@ prompt_template = "Generate ideas about: $topic\"""",
),
],
)
- def test_llm_pipe_to_toml_string(self, pipe_name: str, blueprint: PipeLLMBlueprint, expected_toml: str):
- """Test converting LLM pipe blueprint to TOML string."""
- result = PipelexInterpreter.llm_pipe_to_toml_string(pipe_name, blueprint, "test_domain")
- assert result == expected_toml
+ def test_llm_pipe_to_plx_string(self, pipe_name: str, blueprint: PipeLLMBlueprint, expected_plx: str):
+ """Test converting LLM pipe blueprint to PLX string."""
+ result = PipelexInterpreter.llm_pipe_to_plx_string(pipe_name, blueprint, "test_domain")
+ assert result == expected_plx
diff --git a/tests/unit/pipelex/core/interpreter/test_pipelex_interpreter_ocr_toml.py b/tests/unit/pipelex/core/interpreter/test_pipelex_interpreter_ocr_plx.py
similarity index 67%
rename from tests/unit/pipelex/core/interpreter/test_pipelex_interpreter_ocr_toml.py
rename to tests/unit/pipelex/core/interpreter/test_pipelex_interpreter_ocr_plx.py
index d59fa8a19..c59a65692 100644
--- a/tests/unit/pipelex/core/interpreter/test_pipelex_interpreter_ocr_toml.py
+++ b/tests/unit/pipelex/core/interpreter/test_pipelex_interpreter_ocr_plx.py
@@ -1,16 +1,14 @@
-"""Test PipelexInterpreter OCR pipe to TOML string conversion."""
-
import pytest
from pipelex.core.interpreter import PipelexInterpreter
from pipelex.pipe_operators.ocr.pipe_ocr_blueprint import PipeOcrBlueprint
-class TestPipelexInterpreterOcrToml:
- """Test OCR pipe to TOML string conversion."""
+class TestPipelexInterpreterOcrPLX:
+ """Test OCR pipe to PLX string conversion."""
@pytest.mark.parametrize(
- "pipe_name,blueprint,expected_toml",
+ "pipe_name,blueprint,expected_plx",
[
# Basic OCR pipe
(
@@ -42,7 +40,7 @@ output = "Page\"""",
),
],
)
- def test_ocr_pipe_to_toml_string(self, pipe_name: str, blueprint: PipeOcrBlueprint, expected_toml: str):
- """Test converting OCR pipe blueprint to TOML string."""
- result = PipelexInterpreter.ocr_pipe_to_toml_string(pipe_name, blueprint, "test_domain")
- assert result == expected_toml
+ def test_ocr_pipe_to_plx_string(self, pipe_name: str, blueprint: PipeOcrBlueprint, expected_plx: str):
+ """Test converting OCR pipe blueprint to PLX string."""
+ result = PipelexInterpreter.ocr_pipe_to_plx_string(pipe_name, blueprint, "test_domain")
+ assert result == expected_plx
diff --git a/tests/unit/pipelex/core/interpreter/test_pipelex_interpreter_parallel_toml.py b/tests/unit/pipelex/core/interpreter/test_pipelex_interpreter_parallel_plx.py
similarity index 80%
rename from tests/unit/pipelex/core/interpreter/test_pipelex_interpreter_parallel_toml.py
rename to tests/unit/pipelex/core/interpreter/test_pipelex_interpreter_parallel_plx.py
index 52d5c6e01..e2a086d3c 100644
--- a/tests/unit/pipelex/core/interpreter/test_pipelex_interpreter_parallel_toml.py
+++ b/tests/unit/pipelex/core/interpreter/test_pipelex_interpreter_parallel_plx.py
@@ -1,5 +1,3 @@
-"""Test PipelexInterpreter Parallel pipe to TOML string conversion."""
-
import pytest
from pipelex.core.interpreter import PipelexInterpreter
@@ -7,11 +5,11 @@ from pipelex.pipe_controllers.parallel.pipe_parallel_blueprint import PipeParall
from pipelex.pipe_controllers.sub_pipe_blueprint import SubPipeBlueprint
-class TestPipelexInterpreterParallelToml:
- """Test Parallel pipe to TOML string conversion."""
+class TestPipelexInterpreterParallelPLX:
+ """Test Parallel pipe to PLX string conversion."""
@pytest.mark.parametrize(
- "pipe_name,blueprint,expected_toml",
+ "pipe_name,blueprint,expected_plx",
[
# Basic Parallel pipe
(
@@ -65,7 +63,7 @@ combined_output = "MergedResults\"""",
),
],
)
- def test_parallel_pipe_to_toml_string(self, pipe_name: str, blueprint: PipeParallelBlueprint, expected_toml: str):
- """Test converting Parallel pipe blueprint to TOML string."""
- result = PipelexInterpreter.parallel_pipe_to_toml_string(pipe_name, blueprint, "test_domain")
- assert result == expected_toml
+ def test_parallel_pipe_to_plx_string(self, pipe_name: str, blueprint: PipeParallelBlueprint, expected_plx: str):
+ """Test converting Parallel pipe blueprint to PLX string."""
+ result = PipelexInterpreter.parallel_pipe_to_plx_string(pipe_name, blueprint, "test_domain")
+ assert result == expected_plx
diff --git a/tests/unit/pipelex/core/interpreter/test_pipelex_interpreter_sequence_toml.py b/tests/unit/pipelex/core/interpreter/test_pipelex_interpreter_sequence_plx.py
similarity index 85%
rename from tests/unit/pipelex/core/interpreter/test_pipelex_interpreter_sequence_toml.py
rename to tests/unit/pipelex/core/interpreter/test_pipelex_interpreter_sequence_plx.py
index a4e01e979..3ec650001 100644
--- a/tests/unit/pipelex/core/interpreter/test_pipelex_interpreter_sequence_toml.py
+++ b/tests/unit/pipelex/core/interpreter/test_pipelex_interpreter_sequence_plx.py
@@ -1,4 +1,4 @@
-"""Test PipelexInterpreter Sequence pipe to TOML string conversion."""
+"""Test PipelexInterpreter Sequence pipe to PLX string conversion."""
import pytest
@@ -8,11 +8,11 @@ from pipelex.pipe_controllers.sequence.pipe_sequence_blueprint import PipeSequen
from pipelex.pipe_controllers.sub_pipe_blueprint import SubPipeBlueprint
-class TestPipelexInterpreterSequenceToml:
- """Test Sequence pipe to TOML string conversion."""
+class TestPipelexInterpreterSequencePLX:
+ """Test Sequence pipe to PLX string conversion."""
@pytest.mark.parametrize(
- "pipe_name,blueprint,expected_toml",
+ "pipe_name,blueprint,expected_plx",
[
# Simple sequence pipe with 2 steps
(
@@ -83,7 +83,7 @@ steps = [
),
],
)
- def test_sequence_pipe_to_toml_string(self, pipe_name: str, blueprint: PipeSequenceBlueprint, expected_toml: str):
- """Test converting Sequence pipe blueprint to TOML string."""
- result = PipelexInterpreter.sequence_pipe_to_toml_string(pipe_name, blueprint, "test_domain")
- assert result == expected_toml
+ def test_sequence_pipe_to_plx_string(self, pipe_name: str, blueprint: PipeSequenceBlueprint, expected_plx: str):
+ """Test converting Sequence pipe blueprint to PLX string."""
+ result = PipelexInterpreter.sequence_pipe_to_plx_string(pipe_name, blueprint, "test_domain")
+ assert result == expected_plx
diff --git a/tests/unit/pipelex/core/interpreter/test_pipelex_interpreter_serialize_sub_pipe.py b/tests/unit/pipelex/core/interpreter/test_pipelex_interpreter_serialize_sub_pipe.py
index f45541981..dac9c022e 100644
--- a/tests/unit/pipelex/core/interpreter/test_pipelex_interpreter_serialize_sub_pipe.py
+++ b/tests/unit/pipelex/core/interpreter/test_pipelex_interpreter_serialize_sub_pipe.py
@@ -104,7 +104,7 @@ class TestPipelexInterpreterSerializeSubPipe:
assert result == expected_result
@pytest.mark.parametrize(
- "sub_pipe_blueprint,expected_toml_string",
+ "sub_pipe_blueprint,expected_plx_string",
[
# Basic sub pipe (step in sequence)
(
@@ -153,7 +153,7 @@ class TestPipelexInterpreterSerializeSubPipe:
),
],
)
- def test_sub_pipe_to_toml_string(self, sub_pipe_blueprint: SubPipeBlueprint, expected_toml_string: str):
- """Test converting SubPipeBlueprint directly to TOML inline table string."""
- result = PipelexInterpreter.sub_pipe_to_toml_string(sub_pipe_blueprint)
- assert result == expected_toml_string
+ def test_sub_pipe_to_plx_string(self, sub_pipe_blueprint: SubPipeBlueprint, expected_plx_string: str):
+ """Test converting SubPipeBlueprint directly to PLX inline table string."""
+ result = PipelexInterpreter.sub_pipe_to_plx_string(sub_pipe_blueprint)
+ assert result == expected_plx_string
diff --git a/tests/unit/pipelex/core/test_data/__init__.py b/tests/unit/pipelex/core/test_data/__init__.py
index c5a5b71ed..fcbd717bb 100644
--- a/tests/unit/pipelex/core/test_data/__init__.py
+++ b/tests/unit/pipelex/core/test_data/__init__.py
@@ -10,7 +10,7 @@ from .concepts.refining_concepts import REFINING_CONCEPT_TEST_CASES
from .concepts.simple_concepts import SIMPLE_CONCEPT_TEST_CASES
from .concepts.structured_concepts import STRUCTURED_CONCEPT_TEST_CASES
from .domain.simple_domains import DOMAIN_TEST_CASES
-from .errors.invalid_toml import ERROR_TEST_CASES
+from .errors.invalid_plx import ERROR_TEST_CASES
from .pipes.controllers.batch.pipe_batch import PIPE_BATCH_TEST_CASES
from .pipes.controllers.condition.pipe_condition import PIPE_CONDITION_TEST_CASES
from .pipes.controllers.parallel.pipe_parallel import PIPE_PARALLEL_TEST_CASES
@@ -23,7 +23,7 @@ from .pipes.operators.ocr.pipe_ocr import PIPE_OCR_TEST_CASES
class InterpreterTestCases:
- """Test cases for PipelexInterpreter with TOML content and expected blueprints."""
+ """Test cases for PipelexInterpreter with PLX content and expected blueprints."""
# Aggregate all valid test cases from organized modules
VALID_TEST_CASES: ClassVar[List[Tuple[str, str, PipelexBundleBlueprint]]] = [
diff --git a/tests/unit/pipelex/core/test_data/errors/invalid_toml.py b/tests/unit/pipelex/core/test_data/errors/invalid_plx.py
similarity index 90%
rename from tests/unit/pipelex/core/test_data/errors/invalid_toml.py
rename to tests/unit/pipelex/core/test_data/errors/invalid_plx.py
index 60c0f332e..4d71aab81 100644
--- a/tests/unit/pipelex/core/test_data/errors/invalid_toml.py
+++ b/tests/unit/pipelex/core/test_data/errors/invalid_plx.py
@@ -1,21 +1,21 @@
-"""Invalid TOML test cases focused on TOML structure and PipelexBundleBlueprint validation."""
+"""Invalid PLX test cases focused on PLX structure and PipelexBundleBlueprint validation."""
from typing import List, Tuple, Type, Union
-import toml
from pydantic import ValidationError
from pipelex.core.domains.exceptions import DomainError
+from pipelex.core.interpreter import PLXDecodeError
-# TOML Syntax Errors
-INVALID_TOML_SYNTAX = (
- "invalid_toml_syntax",
+# PLX Syntax Errors
+INVALID_PLX_SYNTAX = (
+ "invalid_plx_syntax",
"""domain = "test_domain"
-definition = "Domain with invalid TOML syntax"
+definition = "Domain with invalid PLX syntax"
[concept]
InvalidConcept = "This is missing a closing quote""",
- toml.TomlDecodeError,
+ PLXDecodeError,
)
MALFORMED_SECTION = (
@@ -26,7 +26,7 @@ definition = "Domain with malformed section"
[concept
TestConcept = "Missing closing bracket"
""",
- toml.TomlDecodeError,
+ PLXDecodeError,
)
UNCLOSED_STRING = (
@@ -34,7 +34,7 @@ UNCLOSED_STRING = (
"""domain = "test_domain"
definition = "Domain with unclosed string
""",
- toml.TomlDecodeError,
+ PLXDecodeError,
)
DUPLICATE_KEYS = (
@@ -46,7 +46,7 @@ definition = "Duplicate definition key"
[concept]
TestConcept = "A test concept"
""",
- toml.TomlDecodeError,
+ PLXDecodeError,
)
INVALID_ESCAPE_SEQUENCE = (
@@ -57,7 +57,7 @@ definition = "Domain with invalid escape sequence \\z"
[concept]
TestConcept = "A test concept"
""",
- toml.TomlDecodeError,
+ PLXDecodeError,
)
# PipelexBundleBlueprint Structure Errors
@@ -182,7 +182,7 @@ definition = "Domain with invalid table syntax"
[concept.]
InvalidName = "Empty table name"
""",
- toml.TomlDecodeError,
+ PLXDecodeError,
)
INVALID_ARRAY_SYNTAX = (
@@ -203,13 +203,13 @@ definition = "Domain with invalid array syntax"
[concept]
[concept]
""",
- toml.TomlDecodeError,
+ PLXDecodeError,
)
# Export all error test cases
ERROR_TEST_CASES: List[Tuple[str, str, Union[Type[Exception], Tuple[Type[Exception], ...]]]] = [
- # TOML Syntax Errors
- INVALID_TOML_SYNTAX,
+ # PLX Syntax Errors
+ INVALID_PLX_SYNTAX,
MALFORMED_SECTION,
UNCLOSED_STRING,
DUPLICATE_KEYS,
diff --git a/tests/unit/pipelex/create/test_structured_output_generator.py b/tests/unit/pipelex/create/test_structured_output_generator.py
index 297c4b8cc..0798cfee7 100644
--- a/tests/unit/pipelex/create/test_structured_output_generator.py
+++ b/tests/unit/pipelex/create/test_structured_output_generator.py
@@ -407,9 +407,9 @@ class TestStructureGenerator:
def test_mixed_structure_blueprint_normalization(self):
"""Test that mixed structure blueprints (strings and ConceptStructureBlueprint objects) are properly normalized."""
- # Create a mixed structure blueprint similar to what would come from TOML parsing
+ # Create a mixed structure blueprint similar to what would come from PLX parsing
mixed_structure_blueprint: Dict[str, ConceptStructureBlueprintType] = {
- "name": "The name of the person", # Simple string definition
+ "name": "The name of the person",
"age": ConceptStructureBlueprint(definition="The age of the person", type=ConceptStructureBlueprintFieldType.NUMBER, required=True),
"birthdate": ConceptStructureBlueprint(
definition="The birthdate of the person", type=ConceptStructureBlueprintFieldType.DATE, required=True
diff --git a/tests/unit/pipelex/migration/test_migrate_v0_1_0_to_v0_2_0.py b/tests/unit/pipelex/migration/test_migrate_v0_1_0_to_v0_2_0.py
index 747ecbaa7..561a64696 100644
--- a/tests/unit/pipelex/migration/test_migrate_v0_1_0_to_v0_2_0.py
+++ b/tests/unit/pipelex/migration/test_migrate_v0_1_0_to_v0_2_0.py
@@ -2,16 +2,16 @@ from pathlib import Path
import pytest
-from pipelex.migration.migrate_v0_1_0_to_v0_2_0 import MigrationResult, TomlMigrator, migrate_concept_syntax
+from pipelex.migration.migrate_v0_1_0_to_v0_2_0 import MigrationResult, TOMLMigrator, migrate_concept_syntax
class TestTomlMigrator:
"""Unit tests for TomlMigrator class."""
@pytest.fixture
- def migrator(self) -> TomlMigrator:
+ def migrator(self) -> TOMLMigrator:
"""Create a TomlMigrator instance."""
- return TomlMigrator()
+ return TOMLMigrator()
@pytest.fixture
def sample_old_syntax_content(self) -> str:
@@ -61,7 +61,7 @@ definition = "This one is already migrated"
refines = "Text"
"""
- def test_pattern_matching(self, migrator: TomlMigrator) -> None:
+ def test_pattern_matching(self, migrator: TOMLMigrator) -> None:
"""Test that the regex pattern correctly identifies Concept = lines."""
test_content = """[concept.TestConcept]
Concept = "A test concept"
@@ -83,7 +83,7 @@ Concept = "This should be caught"
assert matches[1].group(2) == "Concept"
assert matches[1].group(4) == '"This should be caught"'
- def test_pattern_replacement(self, migrator: TomlMigrator) -> None:
+ def test_pattern_replacement(self, migrator: TOMLMigrator) -> None:
"""Test that the regex pattern correctly replaces Concept = with definition =."""
test_content = """[concept.TestConcept]
Concept = "A test concept"
@@ -106,7 +106,7 @@ refines = "Text"
result = migrator.migrate_content(test_content)
assert result == expected_content
- def test_preserves_formatting(self, migrator: TomlMigrator) -> None:
+ def test_preserves_formatting(self, migrator: TOMLMigrator) -> None:
"""Test that migration preserves indentation and spacing."""
test_cases = [
# No indentation
@@ -127,7 +127,7 @@ refines = "Text"
result = migrator.migrate_content(original)
assert result == expected, f"Failed for: {original}"
- def test_ignores_non_concept_lines(self, migrator: TomlMigrator) -> None:
+ def test_ignores_non_concept_lines(self, migrator: TOMLMigrator) -> None:
"""Test that migration doesn't affect non-concept Concept = lines."""
# These should NOT be changed
test_content = """# This is a comment about Concept = something
@@ -139,7 +139,7 @@ prompt_template = "Define the Concept = whatever"
# Should be unchanged since none start with Concept =
assert result == test_content
- def test_ignores_concept_inside_multiline_strings(self, migrator: TomlMigrator) -> None:
+ def test_ignores_concept_inside_multiline_strings(self, migrator: TOMLMigrator) -> None:
"""Test that migration ignores Concept = inside multiline strings."""
test_content = '''domain = "test"
@@ -172,7 +172,7 @@ refines = "Document"
assert 'Concept = "This should be migrated"' not in result
assert 'Concept = "This should also be migrated"' not in result
- def test_multiline_string_detection_with_single_quotes(self, migrator: TomlMigrator) -> None:
+ def test_multiline_string_detection_with_single_quotes(self, migrator: TOMLMigrator) -> None:
"""Test that multiline string detection works with both double and single quotes."""
test_content = """domain = "test"
@@ -198,12 +198,12 @@ Concept = "Should also be migrated"
# Concept inside single-quote multiline string should NOT be migrated
assert 'Concept = "Should NOT be migrated"' in result
- def test_needs_migration_detection(self, migrator: TomlMigrator, sample_old_syntax_content: str, sample_new_syntax_content: str) -> None:
+ def test_needs_migration_detection(self, migrator: TOMLMigrator, sample_old_syntax_content: str, sample_new_syntax_content: str) -> None:
"""Test needs_migration correctly identifies files that need migration."""
assert migrator.needs_migration(sample_old_syntax_content) is True
assert migrator.needs_migration(sample_new_syntax_content) is False
- def test_get_migration_preview(self, migrator: TomlMigrator) -> None:
+ def test_get_migration_preview(self, migrator: TOMLMigrator) -> None:
"""Test getting preview of migration changes."""
test_content = """[concept.TestConcept]
Concept = "A test concept"
@@ -226,7 +226,7 @@ refines = "Text"
assert changes[1]["new_line"] == 'definition = "Another concept"'
def test_migrate_file_success(
- self, migrator: TomlMigrator, tmp_path: Path, sample_old_syntax_content: str, sample_new_syntax_content: str
+ self, migrator: TOMLMigrator, tmp_path: Path, sample_old_syntax_content: str, sample_new_syntax_content: str
) -> None:
"""Test successful file migration."""
test_file = tmp_path / "test.toml"
@@ -247,7 +247,7 @@ refines = "Text"
# Check changes count
assert changes_count == 2 # Two "Concept =" lines in the sample
- def test_migrate_file_no_changes_needed(self, migrator: TomlMigrator, tmp_path: Path, sample_new_syntax_content: str) -> None:
+ def test_migrate_file_no_changes_needed(self, migrator: TOMLMigrator, tmp_path: Path, sample_new_syntax_content: str) -> None:
"""Test file migration when no changes are needed."""
test_file = tmp_path / "test.toml"
test_file.write_text(sample_new_syntax_content)
@@ -266,7 +266,7 @@ refines = "Text"
assert changes_count == 0
def test_migrate_file_without_backup(
- self, migrator: TomlMigrator, tmp_path: Path, sample_old_syntax_content: str, sample_new_syntax_content: str
+ self, migrator: TOMLMigrator, tmp_path: Path, sample_old_syntax_content: str, sample_new_syntax_content: str
) -> None:
"""Test file migration without creating backup."""
test_file = tmp_path / "test.toml"
@@ -285,7 +285,7 @@ refines = "Text"
# Check changes count
assert changes_count == 2
- def test_find_toml_files(self, migrator: TomlMigrator, tmp_path: Path) -> None:
+ def test_find_toml_files(self, migrator: TOMLMigrator, tmp_path: Path) -> None:
"""Test finding TOML files in directory and subdirectories."""
# Create some TOML files
(tmp_path / "file1.toml").write_text("content1")
@@ -311,14 +311,14 @@ refines = "Text"
assert toml_files == expected_files
- def test_find_toml_files_nonexistent_directory(self, migrator: TomlMigrator, tmp_path: Path) -> None:
+ def test_find_toml_files_nonexistent_directory(self, migrator: TOMLMigrator, tmp_path: Path) -> None:
"""Test finding TOML files in nonexistent directory."""
nonexistent_dir = tmp_path / "nonexistent"
with pytest.raises(FileNotFoundError):
migrator.find_toml_files(nonexistent_dir)
- def test_migrate_directory_success(self, migrator: TomlMigrator, tmp_path: Path) -> None:
+ def test_migrate_directory_success(self, migrator: TOMLMigrator, tmp_path: Path) -> None:
"""Test successful directory migration."""
# Create files with different states
file1 = tmp_path / "file1.toml"
@@ -358,7 +358,7 @@ Concept = "Another old concept"
assert not (tmp_path / "file2.toml.backup").exists() # No changes needed
assert (tmp_path / "file3.toml.backup").exists()
- def test_migrate_directory_dry_run(self, migrator: TomlMigrator, tmp_path: Path) -> None:
+ def test_migrate_directory_dry_run(self, migrator: TOMLMigrator, tmp_path: Path) -> None:
"""Test directory migration in dry-run mode."""
# Create file with old syntax
test_file = tmp_path / "test.toml"
@@ -384,7 +384,7 @@ Concept = "Old syntax"
backup_file = tmp_path / "test.toml.backup"
assert not backup_file.exists()
- def test_migrate_directory_no_toml_files(self, migrator: TomlMigrator, tmp_path: Path) -> None:
+ def test_migrate_directory_no_toml_files(self, migrator: TOMLMigrator, tmp_path: Path) -> None:
"""Test directory migration with no TOML files."""
# Create non-TOML file
(tmp_path / "file.txt").write_text("not toml")
diff --git a/tests/unit/pipelex/tools/misc/test_toml_utils.py b/tests/unit/pipelex/tools/misc/test_toml_utils.py
index fb7d9fad7..d9ac548eb 100644
--- a/tests/unit/pipelex/tools/misc/test_toml_utils.py
+++ b/tests/unit/pipelex/tools/misc/test_toml_utils.py
@@ -10,10 +10,10 @@ from pipelex.tools.misc.toml_utils import (
)
-class TestTomlUtils:
- def test_load_toml_from_path_valid_file(self, tmp_path: Path) -> None:
- """Test loading a valid TOML file without issues."""
- toml_content = """domain = "test_domain"
+class TestPLXUtils:
+ def test_load_plx_from_path_valid_file(self, tmp_path: Path) -> None:
+ """Test loading a valid PLX file without issues."""
+ plx_content = """domain = "test_domain"
definition = "Test definition"
[concept]
@@ -27,10 +27,10 @@ prompt_template = '''
This is a test prompt
'''
"""
- toml_file = tmp_path / "valid.toml"
- toml_file.write_text(toml_content)
+ plx_file = tmp_path / "valid.plx"
+ plx_file.write_text(plx_content)
- result = load_toml_from_path(str(toml_file))
+ result = load_toml_from_path(str(plx_file))
assert isinstance(result, dict)
assert result["domain"] == "test_domain"
@@ -38,25 +38,25 @@ This is a test prompt
assert "concept" in result
assert "pipe" in result
- def test_validate_toml_file_trailing_whitespace(self, tmp_path: Path) -> None:
+ def test_validate_plx_file_trailing_whitespace(self, tmp_path: Path) -> None:
"""Test detection of trailing whitespace."""
- toml_content = """domain = "test"
+ plx_content = """domain = "test"
definition = "Test"
"""
- toml_file = tmp_path / "trailing_space.toml"
- toml_file.write_text(toml_content)
+ plx_file = tmp_path / "trailing_space.plx"
+ plx_file.write_text(plx_content)
with pytest.raises(TOMLValidationError) as exc_info:
- validate_toml_file(str(toml_file))
+ validate_toml_file(str(plx_file))
error_msg = str(exc_info.value)
assert "Trailing whitespace detected" in error_msg
assert "Line 1" in error_msg
assert "Line 2" in error_msg
- def test_validate_toml_file_trailing_space_after_triple_quotes(self, tmp_path: Path) -> None:
+ def test_validate_plx_file_trailing_space_after_triple_quotes(self, tmp_path: Path) -> None:
"""Test detection of trailing whitespace after triple quotes."""
- toml_content = '''domain = "test"
+ plx_content = '''domain = "test"
[pipe.test_pipe]
type = "PipeLLM"
@@ -65,92 +65,92 @@ prompt_template = """
Output this only: "test"
"""
'''
- toml_file = tmp_path / "trailing_quotes.toml"
- toml_file.write_text(toml_content)
+ plx_file = tmp_path / "trailing_quotes.plx"
+ plx_file.write_text(plx_content)
with pytest.raises(TOMLValidationError) as exc_info:
- validate_toml_file(str(toml_file))
+ validate_toml_file(str(plx_file))
error_msg = str(exc_info.value)
assert "Trailing whitespace after triple quotes" in error_msg
assert "Line 8" in error_msg
@pytest.mark.skip(reason="Mixed line ending detection needs refinement - focusing on trailing whitespace detection")
- def test_validate_toml_file_mixed_line_endings(self, tmp_path: Path) -> None:
+ def test_validate_plx_file_mixed_line_endings(self, tmp_path: Path) -> None:
"""Test detection of mixed line endings."""
# Create content with explicit mixed line endings - use binary mode to ensure exact control
- toml_file = tmp_path / "mixed_endings.toml"
+ plx_file = tmp_path / "mixed_endings.plx"
# Write content with mixed line endings directly in binary mode
mixed_content = b'domain = "test"\r\ndefinition = "Test"\nextra = "value"\n'
- toml_file.write_bytes(mixed_content)
+ plx_file.write_bytes(mixed_content)
with pytest.raises(TOMLValidationError) as exc_info:
- validate_toml_file(str(toml_file))
+ validate_toml_file(str(plx_file))
error_msg = str(exc_info.value)
assert "Mixed line endings detected" in error_msg
- def test_load_toml_from_path_no_validation_by_default(self, tmp_path: Path) -> None:
+ def test_load_plx_from_path_no_validation_by_default(self, tmp_path: Path) -> None:
"""Test that loading works normally without validation."""
- toml_content = """domain = "test"
+ plx_content = """domain = "test"
definition = "Test with trailing space"
"""
- toml_file = tmp_path / "no_validation.toml"
- toml_file.write_text(toml_content)
+ plx_file = tmp_path / "no_validation.plx"
+ plx_file.write_text(plx_content)
# Should not raise - loading doesn't validate by default
- result = load_toml_from_path(str(toml_file))
+ result = load_toml_from_path(str(plx_file))
assert isinstance(result, dict)
assert result["domain"] == "test"
- def test_failable_load_toml_from_path_nonexistent_file(self) -> None:
+ def test_failable_load_plx_from_path_nonexistent_file(self) -> None:
"""Test failable loading with non-existent file."""
- result = failable_load_toml_from_path("/nonexistent/path.toml")
+ result = failable_load_toml_from_path("/nonexistent/path.plx")
assert result is None
- def test_failable_load_toml_from_path_valid_file(self, tmp_path: Path) -> None:
+ def test_failable_load_plx_from_path_valid_file(self, tmp_path: Path) -> None:
"""Test failable loading with valid file."""
- toml_content = """domain = "test"
+ plx_content = """domain = "test"
definition = "Test definition"
"""
- toml_file = tmp_path / "valid.toml"
- toml_file.write_text(toml_content)
+ plx_file = tmp_path / "valid.plx"
+ plx_file.write_text(plx_content)
- result = failable_load_toml_from_path(str(toml_file))
+ result = failable_load_toml_from_path(str(plx_file))
assert result is not None
assert result["domain"] == "test"
- def test_failable_load_toml_from_path_with_whitespace_works(self, tmp_path: Path) -> None:
+ def test_failable_load_plx_from_path_with_whitespace_works(self, tmp_path: Path) -> None:
"""Test failable loading works normally with whitespace."""
- toml_content = """domain = "test"
+ plx_content = """domain = "test"
"""
- toml_file = tmp_path / "with_whitespace.toml"
- toml_file.write_text(toml_content)
+ plx_file = tmp_path / "with_whitespace.plx"
+ plx_file.write_text(plx_content)
# Should work fine - loading doesn't validate by default
- result = failable_load_toml_from_path(str(toml_file))
+ result = failable_load_toml_from_path(str(plx_file))
assert result is not None
assert result["domain"] == "test"
- def test_validate_toml_file_valid_file_passes(self, tmp_path: Path) -> None:
+ def test_validate_plx_file_valid_file_passes(self, tmp_path: Path) -> None:
"""Test that validation passes for valid files."""
- toml_content = """domain = "test"
+ plx_content = """domain = "test"
definition = "Test definition"
[concept]
TestConcept = "A test concept"
"""
- toml_file = tmp_path / "valid.toml"
- toml_file.write_text(toml_content)
+ plx_file = tmp_path / "valid.plx"
+ plx_file.write_text(plx_content)
# Should not raise
- validate_toml_file(str(toml_file))
+ validate_toml_file(str(plx_file))
def test_validate_toml_file_multiple_validation_issues(self, tmp_path: Path) -> None:
"""Test that multiple validation issues are all reported."""
- toml_content = """domain = "test"
+ plx_content = """domain = "test"
definition = "Test"
[pipe.test_pipe]
@@ -158,11 +158,11 @@ prompt_template = \"\"\"
Output: "test"
\"\"\"
"""
- toml_file = tmp_path / "multiple_issues.toml"
- toml_file.write_text(toml_content)
+ plx_file = tmp_path / "multiple_issues.plx"
+ plx_file.write_text(plx_content)
with pytest.raises(TOMLValidationError) as exc_info:
- validate_toml_file(str(toml_file))
+ validate_toml_file(str(plx_file))
error_msg = str(exc_info.value)
# Should detect multiple lines with trailing whitespace
@@ -171,23 +171,23 @@ Output: "test"
assert "Line 7" in error_msg
assert "Trailing whitespace after triple quotes" in error_msg
- def test_validate_toml_file_error_contains_file_path(self, tmp_path: Path) -> None:
+ def test_validate_plx_file_error_contains_file_path(self, tmp_path: Path) -> None:
"""Test that validation error includes the file path."""
- toml_content = """domain = "test"
+ plx_content = """domain = "test"
"""
- toml_file = tmp_path / "path_test.toml"
- toml_file.write_text(toml_content)
+ plx_file = tmp_path / "path_test.plx"
+ plx_file.write_text(plx_content)
with pytest.raises(TOMLValidationError) as exc_info:
- validate_toml_file(str(toml_file))
+ validate_toml_file(str(plx_file))
error_msg = str(exc_info.value)
- assert str(toml_file) in error_msg
+ assert str(plx_file) in error_msg
assert "TOML formatting issues" in error_msg
- def test_validate_toml_file_pipe_condition_real_case(self, tmp_path: Path) -> None:
- """Test the exact scenario from pipe_condition_2.toml with trailing space after triple quotes."""
- toml_content = '''domain = "test_pipe_condition_2"
+ def test_validate_plx_file_pipe_condition_real_case(self, tmp_path: Path) -> None:
+ """Test the exact scenario from pipe_condition_2.plx with trailing space after triple quotes."""
+ plx_content = '''domain = "test_pipe_condition_2"
definition = "Simple test for PipeCondition functionality using expression"
[concept]
@@ -213,19 +213,19 @@ output = "native.Text"
prompt_template = """
Output this only: "large"
""" '''
- toml_file = tmp_path / "pipe_condition_real_case.toml"
- toml_file.write_text(toml_content)
+ plx_file = tmp_path / "pipe_condition_real_case.plx"
+ plx_file.write_text(plx_content)
with pytest.raises(TOMLValidationError) as exc_info:
- validate_toml_file(str(toml_file))
+ validate_toml_file(str(plx_file))
error_msg = str(exc_info.value)
assert "Trailing whitespace after triple quotes" in error_msg
assert "Line 26" in error_msg # The line with """ followed by space
- def test_validate_toml_file_actual_problematic_file(self) -> None:
+ def test_validate_plx_file_actual_problematic_file(self) -> None:
"""Test validation on the actual problematic file from the codebase."""
- problematic_file = "tests/data/tools_data/problematic_test_cases.toml"
+ problematic_file = "tests/data/tools_data/problematic_test_cases.plx"
# This should catch multiple trailing whitespace issues
with pytest.raises(TOMLValidationError) as exc_info:
diff --git a/uv.lock b/uv.lock
index 598d8ffaa..bde626364 100644
--- a/uv.lock
+++ b/uv.lock
@@ -1865,7 +1865,7 @@ wheels = [
[[package]]
name = "pipelex"
-version = "0.8.1"
+version = "0.9.0"
source = { editable = "." }
dependencies = [
{ name = "aiofiles" },