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.

Validate blueprint now calling validate_libraries()

Louis Choquel73dea6f76fab
diff --git a/pipelex/create/build_blueprint.py b/pipelex/create/build_blueprint.py
index 183fbdeca..6e8498e15 100644
--- a/pipelex/create/build_blueprint.py
+++ b/pipelex/create/build_blueprint.py
@@ -142,6 +142,9 @@ async def validate_blueprint(blueprint_path: str) -> None:
log.info(f"Loaded pipes: {generated_pipe_codes}")
# Run validation
- log.info("Validating pipes...")
+ log.info("Validating pipes ----------------------")
+ log.info("Validating libraries ----------------------")
+ get_library_manager().validate_libraries()
+ log.info("Dry running pipes...")
await dry_run_pipe_codes(pipe_codes=generated_pipe_codes)
log.info(f"✅ All pipes validated successfully: {generated_pipe_codes}")
diff --git a/pipelex/libraries/library_manager.py b/pipelex/libraries/library_manager.py
index 4ce896929..47e868673 100644
--- a/pipelex/libraries/library_manager.py
+++ b/pipelex/libraries/library_manager.py
@@ -274,6 +274,7 @@ class LibraryManager(LibraryManagerAbstract):
error_msg=error_msg,
) from exc
+ @override
def validate_libraries(self):
log.debug("LibraryManager validating libraries")
if self.llm_deck is None:
@@ -459,7 +460,7 @@ Old syntax will be removed in v0.3.0.
log.dev("Making Pipe blueprint")
# Determine pipe class name from details
if "type" in details_dict and "definition" in details_dict:
- pipe_class_name = details_dict["type"]
+ pipe_class_name = details_dict.pop("type")
normalized_details = details_dict.copy()
log.dev(f"New format, pipe_class_name: {pipe_class_name}")
log.dev(f"Normalized details: {normalized_details}")
diff --git a/pipelex/libraries/library_manager_abstract.py b/pipelex/libraries/library_manager_abstract.py
index 67f1c0047..7f1d6553f 100644
--- a/pipelex/libraries/library_manager_abstract.py
+++ b/pipelex/libraries/library_manager_abstract.py
@@ -19,3 +19,7 @@ class LibraryManagerAbstract(ABC):
@abstractmethod
def get_plugin_config_path(self) -> str:
pass
+
+ @abstractmethod
+ def validate_libraries(self) -> None:
+ pass
diff --git a/pipelex/pipe_operators/pipe_img_gen.py b/pipelex/pipe_operators/pipe_img_gen.py
index 21a146c0b..742b9c18f 100644
--- a/pipelex/pipe_operators/pipe_img_gen.py
+++ b/pipelex/pipe_operators/pipe_img_gen.py
@@ -89,7 +89,10 @@ class PipeImgGen(PipeOperator):
@override
def required_variables(self) -> Set[str]:
- return {"imgg_prompt"}
+ if self.img_gen_prompt_var_name:
+ return {self.img_gen_prompt_var_name}
+ else:
+ return {"imgg_prompt"}
def _validate_inputs(self):
concept_provider = get_concept_provider()
@@ -158,6 +161,8 @@ class PipeImgGen(PipeOperator):
log.error(missing_input_var_error.desc())
case StaticValidationReaction.RAISE:
raise missing_input_var_error
+ else:
+ self.img_gen_prompt_var_name = candidate_prompt_var_names[0]
@override
async def _run_operator_pipe(