mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-02-12 07:45:14 -05:00
update OpenAPI schema and add back model_rebuild
This commit is contained in:
@@ -61,9 +61,18 @@ class Webhook(BaseDbModel):
|
||||
)
|
||||
|
||||
|
||||
# LibraryAgentPreset import must be after Webhook definition to avoid
|
||||
# broken circular import:
|
||||
# integrations.py → library/model.py → integrations.py (for Webhook)
|
||||
from backend.api.features.library.model import LibraryAgentPreset # noqa: E402
|
||||
|
||||
# Resolve forward refs
|
||||
LibraryAgentPreset.model_rebuild()
|
||||
|
||||
|
||||
class WebhookWithRelations(Webhook):
|
||||
triggered_nodes: list[NodeModel]
|
||||
triggered_presets: list["LibraryAgentPreset"]
|
||||
triggered_presets: list[LibraryAgentPreset]
|
||||
|
||||
@staticmethod
|
||||
def from_db(webhook: IntegrationWebhook):
|
||||
@@ -82,11 +91,6 @@ class WebhookWithRelations(Webhook):
|
||||
)
|
||||
|
||||
|
||||
# LibraryAgentPreset import must be after WebhookWithRelations definition to avoid
|
||||
# broken circular import:
|
||||
# integrations.py → library/model.py → integrations.py (for Webhook)
|
||||
from backend.api.features.library.model import LibraryAgentPreset # noqa: E402
|
||||
|
||||
# --------------------- CRUD functions --------------------- #
|
||||
|
||||
|
||||
|
||||
@@ -1137,7 +1137,7 @@ const FlowEditor: React.FC<{
|
||||
<AlertTitle>You are building a Trigger Agent</AlertTitle>
|
||||
<AlertDescription>
|
||||
Your agent{" "}
|
||||
{savedAgent?.nodes.some((node) => node.webhook)
|
||||
{savedAgent?.nodes.some((node) => node.webhook_id)
|
||||
? "is listening"
|
||||
: "will listen"}{" "}
|
||||
for its trigger and will run when the time is right.
|
||||
|
||||
@@ -9498,12 +9498,6 @@
|
||||
"webhook_id": {
|
||||
"anyOf": [{ "type": "string" }, { "type": "null" }],
|
||||
"title": "Webhook Id"
|
||||
},
|
||||
"webhook": {
|
||||
"anyOf": [
|
||||
{ "$ref": "#/components/schemas/Webhook" },
|
||||
{ "type": "null" }
|
||||
]
|
||||
}
|
||||
},
|
||||
"type": "object",
|
||||
|
||||
@@ -292,7 +292,7 @@ export type NodeCreatable = {
|
||||
export type Node = NodeCreatable & {
|
||||
input_links: Link[];
|
||||
output_links: Link[];
|
||||
webhook?: Webhook;
|
||||
webhook_id?: string | null;
|
||||
};
|
||||
|
||||
/* Mirror of backend/data/graph.py:Link */
|
||||
|
||||
Reference in New Issue
Block a user