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.
turn field_validator functions into classmethods
thomashebrard1bdbbd251e4f
diff --git a/Makefile b/Makefileindex 27d9637ef..734d12f8a 100644--- a/Makefile+++ b/Makefile@@ -455,7 +455,7 @@ docs-deploy: env### SHORTHANDS##########################################################################################-c: format lint pyright mypy pylint+c: format lint pyright pylint mypy@echo "> done: c = check"cc: cleanderived cdiff --git a/pipelex/core/pipes/pipe_abstract.py b/pipelex/core/pipes/pipe_abstract.pyindex ff94528b8..5e543a183 100644--- a/pipelex/core/pipes/pipe_abstract.py+++ b/pipelex/core/pipes/pipe_abstract.py@@ -25,8 +25,8 @@ class PipeAbstract(ABC, BaseModel):output: Concept@field_validator("code", mode="before")- @staticmethod- def validate_pipe_code_syntax(code: str) -> str:+ @classmethod+ def validate_pipe_code_syntax(cls, code: str) -> str:PipeBlueprint.validate_pipe_code_syntax(pipe_code=code)return codediff --git a/pipelex/pipe_controllers/parallel/pipe_parallel_blueprint.py b/pipelex/pipe_controllers/parallel/pipe_parallel_blueprint.pyindex 9351f0814..d8174a418 100644--- a/pipelex/pipe_controllers/parallel/pipe_parallel_blueprint.py+++ b/pipelex/pipe_controllers/parallel/pipe_parallel_blueprint.py@@ -17,8 +17,8 @@ class PipeParallelBlueprint(PipeBlueprint):combined_output: str | None = None@field_validator("combined_output", mode="before")- @staticmethod- def validate_combined_output(combined_output: str) -> str:+ @classmethod+ def validate_combined_output(cls, combined_output: str) -> str:if combined_output:ConceptBlueprint.validate_concept_string_or_code(concept_string_or_code=combined_output)return combined_outputdiff --git a/pipelex/pipe_operators/llm/pipe_llm_blueprint.py b/pipelex/pipe_operators/llm/pipe_llm_blueprint.pyindex f58c5a59d..279401958 100644--- a/pipelex/pipe_operators/llm/pipe_llm_blueprint.py+++ b/pipelex/pipe_operators/llm/pipe_llm_blueprint.py@@ -39,8 +39,8 @@ class PipeLLMBlueprint(PipeBlueprint):multiple_output: bool | None = None@field_validator("nb_output", mode="after")- @staticmethod- def validate_nb_output(value: int | None = None) -> int | None:+ @classmethod+ def validate_nb_output(cls, value: int | None = None) -> int | None:if value and value < 1:msg = "PipeLLMBlueprint nb_output must be greater than 0"raise PipeDefinitionError(msg)