mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-01-13 17:18:08 -05:00
Compare commits
6 Commits
fix/creden
...
aarushikan
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e0c4fb7871 | ||
|
|
f9d02ad340 | ||
|
|
e08921b5af | ||
|
|
a7b9ee6ab9 | ||
|
|
5cdb382ea4 | ||
|
|
0a4229b15b |
@@ -146,9 +146,6 @@ class AgentInputBlock(Block):
|
||||
description="The value to be passed as input.",
|
||||
default=None,
|
||||
)
|
||||
title: str | None = SchemaField(
|
||||
description="The title of the input.", default=None, advanced=True
|
||||
)
|
||||
description: str | None = SchemaField(
|
||||
description="The description of the input.",
|
||||
default=None,
|
||||
@@ -230,11 +227,6 @@ class AgentOutputBlock(Block):
|
||||
advanced=False,
|
||||
)
|
||||
name: str = SchemaField(description="The name of the output.")
|
||||
title: str | None = SchemaField(
|
||||
description="The title of the output.",
|
||||
default=None,
|
||||
advanced=True,
|
||||
)
|
||||
description: str | None = SchemaField(
|
||||
description="The description of the output.",
|
||||
default=None,
|
||||
|
||||
@@ -194,7 +194,6 @@ class Graph(BaseDbModel):
|
||||
p.name: {
|
||||
"secret": p.secret,
|
||||
"advanced": p.advanced,
|
||||
"title": p.title or p.name,
|
||||
**({"description": p.description} if p.description else {}),
|
||||
**({"default": p.value} if p.value is not None else {}),
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ async def test_get_input_schema(server: SpinTestServer):
|
||||
Node(
|
||||
id="node_0_a",
|
||||
block_id=input_block,
|
||||
input_default={"name": "in_key_a", "title": "Key A", "value": "A"},
|
||||
input_default={"name": "in_key_a", "value": "A"},
|
||||
metadata={"id": "node_0_a"},
|
||||
),
|
||||
Node(
|
||||
@@ -138,20 +138,17 @@ async def test_get_input_schema(server: SpinTestServer):
|
||||
)
|
||||
|
||||
class ExpectedInputSchema(BlockSchema):
|
||||
in_key_a: Any = SchemaField(title="Key A", default="A", advanced=False)
|
||||
in_key_b: Any = SchemaField(title="in_key_b", advanced=True)
|
||||
in_key_a: Any = SchemaField(default="A", advanced=False)
|
||||
in_key_b: Any = SchemaField(advanced=True)
|
||||
|
||||
class ExpectedOutputSchema(BlockSchema):
|
||||
out_key: Any = SchemaField(
|
||||
description="This is an output key",
|
||||
title="out_key",
|
||||
advanced=False,
|
||||
)
|
||||
|
||||
input_schema = created_graph.input_schema
|
||||
input_schema["title"] = "ExpectedInputSchema"
|
||||
assert input_schema == ExpectedInputSchema.jsonschema()
|
||||
|
||||
output_schema = created_graph.output_schema
|
||||
output_schema["title"] = "ExpectedOutputSchema"
|
||||
assert output_schema == ExpectedOutputSchema.jsonschema()
|
||||
|
||||
Reference in New Issue
Block a user