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): exclude schemas with enum from anyOf detection (#11743)

Abhimanyu Yadav17a77b02c7fd
diff --git a/autogpt_platform/frontend/src/components/renderers/InputRenderer/utils/schema-utils.ts b/autogpt_platform/frontend/src/components/renderers/InputRenderer/utils/schema-utils.ts
index b1cfd37967..02ed6ed9c6 100644
--- a/autogpt_platform/frontend/src/components/renderers/InputRenderer/utils/schema-utils.ts
+++ b/autogpt_platform/frontend/src/components/renderers/InputRenderer/utils/schema-utils.ts
@@ -1,7 +1,11 @@
import { getUiOptions, RJSFSchema, UiSchema } from "@rjsf/utils";
export function isAnyOfSchema(schema: RJSFSchema | undefined): boolean {
- return Array.isArray(schema?.anyOf) && schema!.anyOf.length > 0;
+ return (
+ Array.isArray(schema?.anyOf) &&
+ schema!.anyOf.length > 0 &&
+ schema?.enum === undefined
+ );
}
export const isAnyOfChild = (