dify
This commit is contained in:
28
dify/web/app/components/workflow/utils/debug.ts
Normal file
28
dify/web/app/components/workflow/utils/debug.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import type { VarInInspect } from '@/types/workflow'
|
||||
import { VarInInspectType } from '@/types/workflow'
|
||||
import { VarType } from '../types'
|
||||
|
||||
type OutputToVarInInspectParams = {
|
||||
nodeId: string
|
||||
name: string
|
||||
value: any
|
||||
}
|
||||
export const outputToVarInInspect = ({
|
||||
nodeId,
|
||||
name,
|
||||
value,
|
||||
}: OutputToVarInInspectParams): VarInInspect => {
|
||||
return {
|
||||
id: `${Date.now()}`, // TODO: wait for api
|
||||
type: VarInInspectType.node,
|
||||
name,
|
||||
description: '',
|
||||
selector: [nodeId, name],
|
||||
value_type: VarType.string, // TODO: wait for api or get from node
|
||||
value,
|
||||
edited: false,
|
||||
visible: true,
|
||||
is_truncated: false,
|
||||
full_content: { size_bytes: 0, download_url: '' },
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user