Skip to content

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

fix(frontend): Fix typing for `dict`/`dict[Any, Any]` `SchemaField` (#9383)

Krzysztof Czerwinski74b8b45e0a30
diff --git a/autogpt_platform/frontend/src/components/node-input-components.tsx b/autogpt_platform/frontend/src/components/node-input-components.tsx
index e863bd8c82..ea414fafd4 100644
--- a/autogpt_platform/frontend/src/components/node-input-components.tsx
+++ b/autogpt_platform/frontend/src/components/node-input-components.tsx
@@ -662,6 +662,20 @@ export const NodeGenericInputField: FC<{
handleInputClick={handleInputClick}
/>
);
+ case "object":
+ return (
+ <NodeKeyValueInput
+ nodeId={nodeId}
+ selfKey={propKey}
+ schema={propSchema}
+ entries={currentValue}
+ errors={errors}
+ className={className}
+ displayName={displayName}
+ connections={connections}
+ handleInputChange={handleInputChange}
+ />
+ );
default:
console.warn(
`Schema for '${propKey}' specifies unknown type:`,
diff --git a/autogpt_platform/frontend/src/lib/autogpt-server-api/types.ts b/autogpt_platform/frontend/src/lib/autogpt-server-api/types.ts
index a170353ba8..acb72573e8 100644
--- a/autogpt_platform/frontend/src/lib/autogpt-server-api/types.ts
+++ b/autogpt_platform/frontend/src/lib/autogpt-server-api/types.ts
@@ -70,7 +70,7 @@ export type BlockIOObjectSubSchema = BlockIOSubSchemaMeta & {
export type BlockIOKVSubSchema = BlockIOSubSchemaMeta & {
type: "object";
- additionalProperties: { type: "string" | "number" | "integer" };
+ additionalProperties?: { type: "string" | "number" | "integer" };
default?: { [key: string]: string | number };
secret?: boolean;
};