mirror of https://github.com/langgenius/dify.git
fix(trigger): global var dialogue_count and timestamp auto converted to string
This commit is contained in:
parent
6507263b28
commit
3cc6690356
|
|
@ -71,7 +71,7 @@ export const getGlobalVars = (isChatMode: boolean): Var[] => {
|
|||
...((isInWorkflow && !isChatMode) ? [
|
||||
{
|
||||
variable: 'sys.timestamp',
|
||||
type: VarType.integer,
|
||||
type: VarType.number,
|
||||
},
|
||||
] : []),
|
||||
]
|
||||
|
|
|
|||
|
|
@ -1063,7 +1063,8 @@ export const getVarType = ({
|
|||
if (valueSelector[1] === 'index') return VarType.number
|
||||
}
|
||||
|
||||
const isInStartNodeSysVar = isSystemVar(valueSelector) && !isGlobalVar(valueSelector)
|
||||
const isGlobal = isGlobalVar(valueSelector)
|
||||
const isInStartNodeSysVar = isSystemVar(valueSelector) && !isGlobal
|
||||
const isEnv = isENV(valueSelector)
|
||||
const isChatVar = isConversationVar(valueSelector)
|
||||
const isSharedRagVariable
|
||||
|
|
@ -1077,6 +1078,7 @@ export const getVarType = ({
|
|||
|
||||
const targetVarNodeId = (() => {
|
||||
if (isInStartNodeSysVar) return startNode?.id
|
||||
if (isGlobal) return 'global'
|
||||
if (isInNodeRagVariable) return valueSelector[1]
|
||||
return valueSelector[0]
|
||||
})()
|
||||
|
|
@ -1089,7 +1091,7 @@ export const getVarType = ({
|
|||
let type: VarType = VarType.string
|
||||
let curr: any = targetVar.vars
|
||||
|
||||
if (isInStartNodeSysVar || isEnv || isChatVar || isSharedRagVariable) {
|
||||
if (isInStartNodeSysVar || isEnv || isChatVar || isSharedRagVariable || isGlobal) {
|
||||
return curr.find(
|
||||
(v: any) => v.variable === (valueSelector as ValueSelector).join('.'),
|
||||
)?.type
|
||||
|
|
|
|||
Loading…
Reference in New Issue