diff --git a/frontend/src/components/nodes/nodeSidebar/NodeSidebar.tsx b/frontend/src/components/nodes/nodeSidebar/NodeSidebar.tsx index 94a379e4..5691a684 100644 --- a/frontend/src/components/nodes/nodeSidebar/NodeSidebar.tsx +++ b/frontend/src/components/nodes/nodeSidebar/NodeSidebar.tsx @@ -298,9 +298,18 @@ const NodeSidebar: React.FC = ({ nodeID }) => { return incomingNodes.reduce((acc: string[], node) => { if (!node) return acc const config = allNodeConfigs[node.id] - if (config?.output_schema) { + if (config?.output_json_schema) { const nodeTitle = config.title || node.id - return [...acc, ...Object.keys(config.output_schema).map((key) => `${nodeTitle}.${key}`)] + const { schema, error } = extractSchemaFromJsonSchema(config.output_json_schema) + if (error) { + console.error('Error parsing output_json_schema:', error) + return acc + } + if (schema && typeof schema === 'object') { + Object.keys(schema).forEach(key => { + acc.push(`${nodeTitle}.${key}`) + }) + } } return acc }, []) @@ -561,9 +570,9 @@ const NodeSidebar: React.FC = ({ nodeID }) => { // Add useEffect to validate initial schema useEffect(() => { if (currentNodeConfig?.output_json_schema) { - debouncedValidate(currentNodeConfig.output_json_schema); + debouncedValidate(currentNodeConfig.output_json_schema) } - }, [currentNodeConfig?.output_json_schema]); + }, [currentNodeConfig?.output_json_schema]) // Update renderField to handle vector index selection const renderField = (key: string, field: any, value: any, parentPath: string = '', isLast: boolean = false) => {