Skip to content

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(backend): Filter out empty object from conversation_history pin on SmartDecisionMakerBlock

Zamil Majdy900a661266ff
diff --git a/autogpt_platform/backend/backend/blocks/smart_decision_maker.py b/autogpt_platform/backend/backend/blocks/smart_decision_maker.py
index f8f1f1f003..72988b426b 100644
--- a/autogpt_platform/backend/backend/blocks/smart_decision_maker.py
+++ b/autogpt_platform/backend/backend/blocks/smart_decision_maker.py
@@ -338,7 +338,7 @@ class SmartDecisionMakerBlock(Block):
tool_functions = self._create_function_signature(node_id)
input_data.conversation_history = input_data.conversation_history or []
- prompt = [json.to_dict(p) for p in input_data.conversation_history]
+ prompt = [json.to_dict(p) for p in input_data.conversation_history if p]
pending_tool_calls = get_pending_tool_calls(input_data.conversation_history)
if pending_tool_calls and not input_data.last_tool_output: