mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-04-30 03:00:41 -04:00
fix(blocks): add json_schema_extra for images field to prevent frontend crash
When clicking '+ Item' on the Images input field, the frontend was crashing with: TypeError: Cannot read properties of undefined (reading 'type') This was caused by the frontend not being able to determine what type of items to add to the Optional[List[MediaFileType]] array. Added explicit JSON schema with array type and string items with URI format to provide the frontend with the necessary type information. Co-authored-by: Bently <Bentlybro@users.noreply.github.com>
This commit is contained in:
@@ -64,6 +64,10 @@ class AIImageCustomizerBlock(Block):
|
||||
description="List of input images (optional)",
|
||||
default=None,
|
||||
title="Images",
|
||||
json_schema_extra={
|
||||
"type": "array",
|
||||
"items": {"type": "string", "format": "uri"},
|
||||
},
|
||||
)
|
||||
output_format: OutputFormat = SchemaField(
|
||||
description="Format of the output image",
|
||||
|
||||
Reference in New Issue
Block a user