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
Adds better error for missing inputs
Stefan Krawczykeaa0d951c3be
diff --git a/burr/core/application.py b/burr/core/application.pyindex b4387b45..9731a20c 100644--- a/burr/core/application.py+++ b/burr/core/application.py@@ -410,9 +410,20 @@ class Application:)missing_inputs.remove(required_input)if len(missing_inputs) > 0:+ missing_inputs_dict = {key: "FILL ME IN" for key in missing_inputs}+ missing_inputs_dict.update({key: "..." for key in inputs.keys()})+ addendum = (+ "\nPlease double check the values passed to the keyword argument `inputs` to however you're running "+ "the burr application.\n"+ "e.g.\n"+ f" app.run( # or app.step, app.iterate, app.astep, etc.\n"+ f" halt_..., # your halt logic\n"+ f" inputs={missing_inputs_dict} # <-- this is what you need to adjust\n"+ f" )"+ )raise ValueError(f"Action {action.name} is missing required inputs: {missing_inputs}. "- f"Has inputs: {processed_inputs}"+ f"Has inputs: {processed_inputs}. " + addendum)return processed_inputsdiff --git a/examples/multi-modal-chatbot/application.py b/examples/multi-modal-chatbot/application.pyindex 2e91fb1f..19a71fb7 100644--- a/examples/multi-modal-chatbot/application.py+++ b/examples/multi-modal-chatbot/application.py@@ -212,3 +212,4 @@ if __name__ == "__main__":app.visualize(output_file_path="statemachine", include_conditions=False, view=True, format="png")+ app.run(halt_after=["response"])