mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-16 20:56:03 +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[] = []
|
const outputSchema: any[] = []
|
||||||
Object.keys(output_schema.properties).forEach((outputKey) => {
|
Object.keys(output_schema.properties).forEach((outputKey) => {
|
||||||
const output = output_schema.properties[outputKey]
|
const output = output_schema.properties[outputKey]
|
||||||
|
const dataType = output.type
|
||||||
outputSchema.push({
|
outputSchema.push({
|
||||||
variable: outputKey,
|
variable: outputKey,
|
||||||
type: output.type === 'array'
|
type: dataType
|
||||||
? `array[${output.items?.type.slice(0, 1).toLocaleLowerCase()}${output.items?.type.slice(1)}]`
|
? `array[${output.items?.type.slice(0, 1).toLocaleLowerCase()}${output.items?.type.slice(1)}]`
|
||||||
: `${output.type.slice(0, 1).toLocaleLowerCase()}${output.type.slice(1)}`,
|
: `${output.type.slice(0, 1).toLocaleLowerCase()}${output.type.slice(1)}`,
|
||||||
description: output.description,
|
description: output.description,
|
||||||
|
children: output.type === 'object' ? {
|
||||||
|
schema: {
|
||||||
|
type: 'object',
|
||||||
|
properties: output.properties,
|
||||||
|
},
|
||||||
|
} : undefined,
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
res.vars = [
|
res.vars = [
|
||||||
|
@ -17,6 +17,7 @@ import ResultPanel from '@/app/components/workflow/run/result-panel'
|
|||||||
import { useToolIcon } from '@/app/components/workflow/hooks'
|
import { useToolIcon } from '@/app/components/workflow/hooks'
|
||||||
import { useLogs } from '@/app/components/workflow/run/hooks'
|
import { useLogs } from '@/app/components/workflow/run/hooks'
|
||||||
import formatToTracingNodeList from '@/app/components/workflow/run/utils/format-log'
|
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'
|
const i18nPrefix = 'workflow.nodes.tool'
|
||||||
|
|
||||||
@ -148,12 +149,13 @@ const Panel: FC<NodePanelProps<ToolNodeType>> = ({
|
|||||||
description={t(`${i18nPrefix}.outputVars.json`)}
|
description={t(`${i18nPrefix}.outputVars.json`)}
|
||||||
/>
|
/>
|
||||||
{outputSchema.map(outputItem => (
|
{outputSchema.map(outputItem => (
|
||||||
<VarItem
|
// <VarItem
|
||||||
key={outputItem.name}
|
// key={outputItem.name}
|
||||||
name={outputItem.name}
|
// name={outputItem.name}
|
||||||
type={outputItem.type}
|
// type={outputItem.type}
|
||||||
description={outputItem.description}
|
// description={outputItem.description}
|
||||||
/>
|
// />
|
||||||
|
<StructureOutputItem payload={outputItem} />
|
||||||
))}
|
))}
|
||||||
</>
|
</>
|
||||||
</OutputVars>
|
</OutputVars>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user