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.

Output fixed blueprint

Louis Choquelc48eb16bc0bb
diff --git a/pipelex/create/build_blueprint.py b/pipelex/create/build_blueprint.py
index b283808a4..8308506a7 100644
--- a/pipelex/create/build_blueprint.py
+++ b/pipelex/create/build_blueprint.py
@@ -36,18 +36,22 @@ async def do_build_blueprint(
pretty_print(pipeline_draft, title="Pipeline Draft")
# Save or display result
- output_path = output_path or "pipelex/libraries/pipelines/temp/generated_blueprint.toml"
- # blueprint_dict = blueprint.smart_dump()
- # save_toml_to_path(data=blueprint_dict, path=output_path)
- save_pipeline_blueprint_toml_to_path(blueprint=blueprint, path=output_path)
- json_path = output_path.replace(Path(output_path).suffix, ".json")
- save_as_json_to_path(object_to_save=blueprint, path=json_path)
- draft_path = output_path.replace(Path(output_path).suffix, "_draft.md")
+ 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)
- log.info(f"✅ Blueprint saved to '{output_path}'")
+ rough_toml_path = f"{output_path_base}.toml"
+ save_pipeline_blueprint_toml_to_path(blueprint=blueprint, path=rough_toml_path)
+ rough_json_path = f"{output_path_base}.json"
+ save_as_json_to_path(object_to_save=blueprint, path=rough_json_path)
+ log.info(f"✅ Rough blueprint saved to '{output_path_base}'")
load_pipes_from_generated_blueprint(blueprint=blueprint)
log.info("✅ Pipes loaded from blueprint")
if validate:
await validate_blueprint(blueprint=blueprint, is_error_fixing_enabled=True)
+ fixed_toml_path = f"{output_path_base}_fixed.toml"
+ save_pipeline_blueprint_toml_to_path(blueprint=blueprint, path=fixed_toml_path)
+ fixed_json_path = f"{output_path_base}_fixed.json"
+ save_as_json_to_path(object_to_save=blueprint, path=fixed_json_path)
+ log.info(f"✅ Fixed blueprint saved to '{output_path_base}'")