mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-02-05 20:35:10 -05:00
update OpenAPI schema
This commit is contained in:
@@ -394,7 +394,11 @@ class Graph(BaseGraph):
|
||||
properties = {}
|
||||
required_fields = []
|
||||
|
||||
for agg_field_key, (field_info, _, is_required) in graph_credentials_inputs.items():
|
||||
for agg_field_key, (
|
||||
field_info,
|
||||
_,
|
||||
is_required,
|
||||
) in graph_credentials_inputs.items():
|
||||
providers = list(field_info.provider)
|
||||
cred_types = list(field_info.supported_types)
|
||||
|
||||
@@ -872,7 +876,6 @@ class GraphMeta(BaseModel):
|
||||
|
||||
id: str
|
||||
version: int = 1
|
||||
user_id: str
|
||||
is_active: bool = True
|
||||
name: str
|
||||
description: str
|
||||
@@ -880,21 +883,21 @@ class GraphMeta(BaseModel):
|
||||
recommended_schedule_cron: str | None = None
|
||||
forked_from_id: str | None = None
|
||||
forked_from_version: int | None = None
|
||||
user_id: str
|
||||
|
||||
input_schema: dict[str, Any] = {}
|
||||
output_schema: dict[str, Any] = {}
|
||||
credentials_input_schema: dict[str, Any] = {}
|
||||
has_external_trigger: bool = False
|
||||
has_human_in_the_loop: bool = False
|
||||
has_sensitive_action: bool = False
|
||||
trigger_setup_info: Optional["GraphTriggerInfo"] = None
|
||||
input_schema: dict[str, Any]
|
||||
output_schema: dict[str, Any]
|
||||
credentials_input_schema: dict[str, Any]
|
||||
has_external_trigger: bool
|
||||
has_human_in_the_loop: bool
|
||||
has_sensitive_action: bool
|
||||
trigger_setup_info: Optional["GraphTriggerInfo"]
|
||||
|
||||
@staticmethod
|
||||
def from_graph(graph: "GraphModel") -> "GraphMeta":
|
||||
return GraphMeta(
|
||||
id=graph.id,
|
||||
version=graph.version,
|
||||
user_id=graph.user_id,
|
||||
is_active=graph.is_active,
|
||||
name=graph.name,
|
||||
description=graph.description,
|
||||
@@ -902,7 +905,8 @@ class GraphMeta(BaseModel):
|
||||
recommended_schedule_cron=graph.recommended_schedule_cron,
|
||||
forked_from_id=graph.forked_from_id,
|
||||
forked_from_version=graph.forked_from_version,
|
||||
# Pass pre-computed values for expensive fields
|
||||
user_id=graph.user_id,
|
||||
# Pre-computed values (were @computed_field on Graph)
|
||||
input_schema=graph.input_schema,
|
||||
output_schema=graph.output_schema,
|
||||
has_external_trigger=graph.has_external_trigger,
|
||||
|
||||
@@ -7804,68 +7804,57 @@
|
||||
"anyOf": [{ "type": "integer" }, { "type": "null" }],
|
||||
"title": "Forked From Version"
|
||||
},
|
||||
"sub_graphs": {
|
||||
"items": { "$ref": "#/components/schemas/BaseGraph-Output" },
|
||||
"type": "array",
|
||||
"title": "Sub Graphs",
|
||||
"default": []
|
||||
},
|
||||
"user_id": { "type": "string", "title": "User Id" },
|
||||
"input_schema": {
|
||||
"additionalProperties": true,
|
||||
"type": "object",
|
||||
"title": "Input Schema",
|
||||
"readOnly": true
|
||||
"title": "Input Schema"
|
||||
},
|
||||
"output_schema": {
|
||||
"additionalProperties": true,
|
||||
"type": "object",
|
||||
"title": "Output Schema",
|
||||
"readOnly": true
|
||||
"title": "Output Schema"
|
||||
},
|
||||
"credentials_input_schema": {
|
||||
"additionalProperties": true,
|
||||
"type": "object",
|
||||
"title": "Credentials Input Schema"
|
||||
},
|
||||
"has_external_trigger": {
|
||||
"type": "boolean",
|
||||
"title": "Has External Trigger",
|
||||
"readOnly": true
|
||||
"title": "Has External Trigger"
|
||||
},
|
||||
"has_human_in_the_loop": {
|
||||
"type": "boolean",
|
||||
"title": "Has Human In The Loop",
|
||||
"readOnly": true
|
||||
"title": "Has Human In The Loop"
|
||||
},
|
||||
"has_sensitive_action": {
|
||||
"type": "boolean",
|
||||
"title": "Has Sensitive Action",
|
||||
"readOnly": true
|
||||
"title": "Has Sensitive Action"
|
||||
},
|
||||
"trigger_setup_info": {
|
||||
"anyOf": [
|
||||
{ "$ref": "#/components/schemas/GraphTriggerInfo" },
|
||||
{ "type": "null" }
|
||||
],
|
||||
"readOnly": true
|
||||
},
|
||||
"credentials_input_schema": {
|
||||
"additionalProperties": true,
|
||||
"type": "object",
|
||||
"title": "Credentials Input Schema",
|
||||
"readOnly": true
|
||||
]
|
||||
}
|
||||
},
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"name",
|
||||
"description",
|
||||
"user_id",
|
||||
"input_schema",
|
||||
"output_schema",
|
||||
"credentials_input_schema",
|
||||
"has_external_trigger",
|
||||
"has_human_in_the_loop",
|
||||
"has_sensitive_action",
|
||||
"trigger_setup_info",
|
||||
"credentials_input_schema"
|
||||
"trigger_setup_info"
|
||||
],
|
||||
"title": "GraphMeta"
|
||||
"title": "GraphMeta",
|
||||
"description": "Graph metadata without nodes/links \u2014 used for list endpoints.\n\nThis is a flat, lightweight model (not inheriting from Graph) to avoid recomputing\nexpensive computed fields. Values are copied from GraphModel."
|
||||
},
|
||||
"GraphModel": {
|
||||
"properties": {
|
||||
|
||||
Reference in New Issue
Block a user