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.
featuer/error-message-pipelex-init (#58)
Thomas Hebrard8a1ce3cc7e2f
diff --git a/.github/workflows/cla.yml b/.github/workflows/cla.ymlindex 4ea9194cd..5d37b724e 100644--- a/.github/workflows/cla.yml+++ b/.github/workflows/cla.yml@@ -25,7 +25,7 @@ jobs:path-to-signatures: "signatures/version1/cla.json"path-to-document: "https://github.com/Pipelex/pipelex/blob/main/CLA.md"branch: main- allowlist: lchoquel,thomashebrard,antoinepipelex,bot*+ allowlist: lchoquel,thomashebrard,bot*remote-organization-name: Pipelexremote-repository-name: cla-signaturessigned-commit-message: "$contributorName has signed the CLA in $owner/$repo#$pullRequestNo"diff --git a/pipelex/cogt/llm/llm_models/llm_model_library.py b/pipelex/cogt/llm/llm_models/llm_model_library.pyindex d0d15d42c..ebb0573cd 100644--- a/pipelex/cogt/llm/llm_models/llm_model_library.py+++ b/pipelex/cogt/llm/llm_models/llm_model_library.py@@ -64,6 +64,8 @@ class LLMModelLibrary(LLMModelProviderAbstract, RootModel[LLMModelLibraryRoot]):@classmethoddef load_llm_model_library_dict(cls) -> LLMModelLibraryDict:libraries_path = LibraryConfig.exported_llm_integrations_path+ if not os.path.exists(libraries_path):+ raise LLMModelLibraryError(f"LLM model library path `{libraries_path}` not found. Please run `pipelex init-libraries` to create it.")llm_library: LLMModelLibraryDict = {}for library_file_name in sorted(os.listdir(libraries_path)):library_path = os.path.join(libraries_path, library_file_name)diff --git a/pipelex/libraries/library_manager.py b/pipelex/libraries/library_manager.pyindex 18af02daa..25afeea45 100644--- a/pipelex/libraries/library_manager.py+++ b/pipelex/libraries/library_manager.py@@ -1,3 +1,4 @@+import osfrom pathlib import Pathfrom typing import Any, ClassVar, Dict, List, Optional, Type@@ -25,6 +26,10 @@ from pipelex.tools.typing.pydantic_utils import format_pydantic_validation_errorfrom pipelex.types import StrEnum+class LLMDeckNotFoundError(LibraryError):+ pass++class LibraryComponent(StrEnum):CONCEPT = "concept"PIPE = "pipe"@@ -74,8 +79,12 @@ class LibraryManager:def load_deck(self) -> LLMDeck:llm_deck_paths = LibraryConfig.get_llm_deck_paths()full_llm_deck_dict: Dict[str, Any] = {}+ if not llm_deck_paths:+ raise LLMDeckNotFoundError("No LLM deck paths found. Please run `pipelex init-libraries` to create it.")for llm_deck_path in llm_deck_paths:+ if not os.path.exists(llm_deck_path):+ raise LLMDeckNotFoundError(f"LLM deck path `{llm_deck_path}` not found. Please run `pipelex init-libraries` to create it.")llm_deck_dict = load_toml_from_path(path=llm_deck_path)log.debug(f"Loaded LLM deck from {llm_deck_path}")log.verbose(llm_deck_dict)@@ -88,7 +97,6 @@ class LibraryManager:log.debug("LibraryManager loading combo libraries")# Find all .toml files in the directories and their subdirectoriestoml_file_paths: List[Path] = []-for libraries_path in library_paths:# Use the existing utility function specifically for TOML filesfound_file_paths = find_files_in_dir(diff --git a/pipelex/pipelex.py b/pipelex/pipelex.pyindex 6e28e4161..8e990bf39 100644--- a/pipelex/pipelex.py+++ b/pipelex/pipelex.py@@ -199,6 +199,7 @@ class Pipelex:self.library_manager.load_libraries()if self.library_manager.llm_deck is None:raise PipelexSetupError("LLM deck is not loaded")+self.pipelex_hub.set_llm_deck_provider(llm_deck_provider=self.library_manager.llm_deck)self.library_manager.validate_libraries()except ValidationError as exc: