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): Revert custom get_missing_links method on AddToListBlock
Zamil Majdyf8a6c9e67f94
diff --git a/autogpt_platform/backend/backend/blocks/basic.py b/autogpt_platform/backend/backend/blocks/basic.pyindex 0208348aad..f52a53a4eb 100644--- a/autogpt_platform/backend/backend/blocks/basic.py+++ b/autogpt_platform/backend/backend/blocks/basic.py@@ -1,14 +1,7 @@import enum-from typing import TYPE_CHECKING, Any, List--from backend.data.block import (- Block,- BlockCategory,- BlockInput,- BlockOutput,- BlockSchema,- BlockType,-)+from typing import Any, List++from backend.data.block import Block, BlockCategory, BlockOutput, BlockSchema, BlockTypefrom backend.data.model import SchemaFieldfrom backend.util import jsonfrom backend.util.file import MediaFile, store_media_file@@ -16,9 +9,6 @@ from backend.util.mock import MockObjectfrom backend.util.text import TextFormatterfrom backend.util.type import convert-if TYPE_CHECKING:- from backend.data.graph import Link-formatter = TextFormatter()@@ -466,33 +456,6 @@ class AddToListBlock(Block):description="The position to insert the new entry. If not provided, the entry will be appended to the end of the list.",)- @classmethod- def get_missing_links(cls, data: BlockInput, links: List["Link"]) -> set[str]:- # If `list` self-loop present, the `entry` pin can't be static.- list_self_loop_present = any(- link.sink_name == "list" and link.sink_id == link.source_id- for link in links- )- entry_static_output_present = any(- link.sink_name == "entry" and link.is_static for link in links- )- if list_self_loop_present and entry_static_output_present:- raise ValueError(- "The `entry` pin can't have static output from `AgentInput` or "- "`StoreValue` block as long as the `list` pin has a self-loop."- "This will cause an infinite execution loop."- )-- return super().get_missing_links(- data,- [- link- for link in links- # Allow execution with `list` pin self-loop- if link.sink_name != "list" or link.sink_id != link.source_id- ],- )-class Output(BlockSchema):updated_list: List[Any] = SchemaField(description="The list with the new entry added."