chore: temp change tools support schema for test

This commit is contained in:
Joel 2025-03-31 14:13:14 +08:00
parent 9a06b4d248
commit b5f74cbf62
2 changed files with 16 additions and 7 deletions

View File

@ -318,12 +318,19 @@ const formatItem = (
const outputSchema: any[] = []
Object.keys(output_schema.properties).forEach((outputKey) => {
const output = output_schema.properties[outputKey]
const dataType = output.type
outputSchema.push({
variable: outputKey,
type: output.type === 'array'
type: dataType
? `array[${output.items?.type.slice(0, 1).toLocaleLowerCase()}${output.items?.type.slice(1)}]`
: `${output.type.slice(0, 1).toLocaleLowerCase()}${output.type.slice(1)}`,
description: output.description,
children: output.type === 'object' ? {
schema: {
type: 'object',
properties: output.properties,
},
} : undefined,
})
})
res.vars = [

View File

@ -17,6 +17,7 @@ import ResultPanel from '@/app/components/workflow/run/result-panel'
import { useToolIcon } from '@/app/components/workflow/hooks'
import { useLogs } from '@/app/components/workflow/run/hooks'
import formatToTracingNodeList from '@/app/components/workflow/run/utils/format-log'
import StructureOutputItem from '@/app/components/workflow/nodes/_base/components/variable/object-child-tree-panel/show'
const i18nPrefix = 'workflow.nodes.tool'
@ -148,12 +149,13 @@ const Panel: FC<NodePanelProps<ToolNodeType>> = ({
description={t(`${i18nPrefix}.outputVars.json`)}
/>
{outputSchema.map(outputItem => (
<VarItem
key={outputItem.name}
name={outputItem.name}
type={outputItem.type}
description={outputItem.description}
/>
// <VarItem
// key={outputItem.name}
// name={outputItem.name}
// type={outputItem.type}
// description={outputItem.description}
// />
<StructureOutputItem payload={outputItem} />
))}
</>
</OutputVars>