mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-16 10:25:58 +08:00
chore: temp change tools support schema for test
This commit is contained in:
parent
9a06b4d248
commit
b5f74cbf62
@ -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 = [
|
||||
|
@ -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>
|
||||
|
Loading…
x
Reference in New Issue
Block a user