mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-02-11 15:25:16 -05:00
maybe this works?
This commit is contained in:
@@ -1,8 +1,15 @@
|
||||
from backend.api.features.library.model import LibraryAgentPreset
|
||||
|
||||
from .graph import NodeModel
|
||||
from .integrations import Webhook # noqa: F401
|
||||
|
||||
# Resolve Webhook forward references
|
||||
NodeModel.model_rebuild()
|
||||
LibraryAgentPreset.model_rebuild()
|
||||
|
||||
|
||||
def _rebuild_library_agent_preset() -> None:
|
||||
"""Deferred model rebuild to avoid circular import."""
|
||||
from backend.api.features.library.model import LibraryAgentPreset
|
||||
|
||||
LibraryAgentPreset.model_rebuild()
|
||||
|
||||
|
||||
_rebuild_library_agent_preset()
|
||||
|
||||
@@ -24,7 +24,7 @@ from pydantic import BaseModel, BeforeValidator, Field
|
||||
from pydantic.fields import computed_field
|
||||
|
||||
from backend.blocks import get_block, get_blocks
|
||||
from backend.blocks._base import AnyBlockSchema, Block, BlockType, EmptySchema
|
||||
from backend.blocks._base import Block, BlockType, EmptySchema
|
||||
from backend.blocks.agent import AgentExecutorBlock
|
||||
from backend.blocks.io import AgentInputBlock, AgentOutputBlock
|
||||
from backend.blocks.llm import LlmModel
|
||||
@@ -47,6 +47,8 @@ from .db import BaseDbModel, query_raw_with_schema, transaction
|
||||
from .includes import AGENT_GRAPH_INCLUDE, AGENT_NODE_INCLUDE
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from backend.blocks._base import AnyBlockSchema
|
||||
|
||||
from .execution import NodesInputMasks
|
||||
from .integrations import Webhook
|
||||
|
||||
@@ -122,7 +124,7 @@ class Node(BaseDbModel):
|
||||
return self.metadata.get("credentials_optional", False)
|
||||
|
||||
@property
|
||||
def block(self) -> AnyBlockSchema | "_UnknownBlockBase":
|
||||
def block(self) -> "AnyBlockSchema | _UnknownBlockBase":
|
||||
"""Get the block for this node. Returns UnknownBlock if block is deleted/missing."""
|
||||
block = get_block(self.block_id)
|
||||
if not block:
|
||||
|
||||
Reference in New Issue
Block a user