Build applications that make decisions (chatbots, agents, simulations, etc...). Monitor, trace, persist, and execute on your own infrastructure.
Python aiburrchatbot-frameworkdagsgenerative-aigraphshacktoberfestllmopsllmsmlopspersistent-data-structurestate-machinestate-managementvisibility
fix: correct validate_inputs error message when both missing and additional inputs exist
Cao Hanzhe0e883bbb0912
diff --git a/burr/core/action.py b/burr/core/action.pyindex eb6fceff..5a228e0a 100644--- a/burr/core/action.py+++ b/burr/core/action.py@@ -243,16 +243,12 @@ class Function(abc.ABC):missing_inputs = required_inputs - given_inputsadditional_inputs = given_inputs - required_inputs - optional_inputsif missing_inputs or additional_inputs:- raise ValueError(- f"Inputs to function {self} are invalid. "- + f"Missing the following inputs: {', '.join(missing_inputs)}."- if missing_inputs- else (- "" f"Additional inputs: {','.join(additional_inputs)}."- if additional_inputs- else ""- )- )+ parts = [f"Inputs to function {self} are invalid."]+ if missing_inputs:+ parts.append(f"Missing the following inputs: {', '.join(missing_inputs)}.")+ if additional_inputs:+ parts.append(f"Additional inputs: {', '.join(additional_inputs)}.")+ raise ValueError(" ".join(parts))def is_async(self) -> bool:"""Convenience method to check if the function is async or not.