AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
fix(block): Invalid block input error on falsy non-null value
Zamil Majdyc109b676b825
diff --git a/autogpt_platform/backend/backend/executor/utils.py b/autogpt_platform/backend/backend/executor/utils.pyindex b5d8a348e1..2129632c2a 100644--- a/autogpt_platform/backend/backend/executor/utils.py+++ b/autogpt_platform/backend/backend/executor/utils.py@@ -394,7 +394,8 @@ def validate_exec(# Convert non-matching data types to the expected input schema.for name, data_type in schema.__annotations__.items():- if (value := data.get(name)) and (type(value) is not data_type):+ value = data.get(name)+ if (value is not None) and (type(value) is not data_type):data[name] = convert(value, data_type)# Input data (without default values) should contain all required fields.diff --git a/autogpt_platform/frontend/src/components/runner-ui/RunnerInputList.tsx b/autogpt_platform/frontend/src/components/runner-ui/RunnerInputList.tsxindex a52dfca88d..6adf42d03f 100644--- a/autogpt_platform/frontend/src/components/runner-ui/RunnerInputList.tsx+++ b/autogpt_platform/frontend/src/components/runner-ui/RunnerInputList.tsx@@ -20,7 +20,7 @@ export function InputList({ blockInputs, onInputChange }: InputListProps) {schema={block.inputSchema}name={block.hardcodedValues.name}description={block.hardcodedValues.description}- value={block.hardcodedValues.value || ""}+ value={block.hardcodedValues.value ?? ""}placeholder_values={block.hardcodedValues.placeholder_values}onInputChange={onInputChange}/>