diff --git a/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/json-schema-config.tsx b/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/json-schema-config.tsx index fecd1093d9..b87dc6e245 100644 --- a/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/json-schema-config.tsx +++ b/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/json-schema-config.tsx @@ -11,7 +11,6 @@ import VisualEditor from './visual-editor' import SchemaEditor from './schema-editor' import { checkJsonSchemaDepth, - convertBooleanToString, getValidationErrorMessage, jsonToSchema, preValidateSchema, @@ -87,7 +86,6 @@ const JsonSchemaConfig: FC = ({ setValidationError(`Schema exceeds maximum depth of ${JSON_SCHEMA_MAX_DEPTH}.`) return } - convertBooleanToString(schema) const validationErrors = validateSchemaAgainstDraft7(schema) if (validationErrors.length > 0) { setValidationError(getValidationErrorMessage(validationErrors)) @@ -168,7 +166,6 @@ const JsonSchemaConfig: FC = ({ setValidationError(`Schema exceeds maximum depth of ${JSON_SCHEMA_MAX_DEPTH}.`) return } - convertBooleanToString(schema) const validationErrors = validateSchemaAgainstDraft7(schema) if (validationErrors.length > 0) { setValidationError(getValidationErrorMessage(validationErrors)) diff --git a/web/app/components/workflow/nodes/llm/utils.ts b/web/app/components/workflow/nodes/llm/utils.ts index b29646de66..e6736169a5 100644 --- a/web/app/components/workflow/nodes/llm/utils.ts +++ b/web/app/components/workflow/nodes/llm/utils.ts @@ -303,6 +303,7 @@ export const getValidationErrorMessage = (errors: ValidationError[]) => { return message } +// Previous Not support boolean type, so transform boolean to string when paste it into schema editor export const convertBooleanToString = (schema: any) => { if (schema.type === Type.boolean) schema.type = Type.string