mirror of
https://github.com/langgenius/dify.git
synced 2026-02-09 23:20:12 -05:00
chore: Add chat history display name mapping for workflow variables
This commit is contained in:
@@ -86,6 +86,7 @@ export const getGlobalVars = (isChatMode: boolean): Var[] => {
|
||||
export const VAR_SHOW_NAME_MAP: Record<string, string> = {
|
||||
'sys.query': 'query',
|
||||
'sys.files': 'files',
|
||||
'context': 'chat history',
|
||||
}
|
||||
|
||||
export const RETRIEVAL_OUTPUT_STRUCT = `{
|
||||
|
||||
@@ -54,8 +54,10 @@ export const useVarColor = (variables: string[], isExceptionVariable?: boolean,
|
||||
}
|
||||
|
||||
export const useVarName = (variables: string[], notShowFullPath?: boolean) => {
|
||||
const showName = VAR_SHOW_NAME_MAP[variables.join('.')]
|
||||
let variableFullPathName = variables.slice(1).join('.')
|
||||
const fullPathKey = variables.join('.')
|
||||
const keyWithoutNodePrefix = variables.slice(1).join('.')
|
||||
const showName = VAR_SHOW_NAME_MAP[fullPathKey] ?? VAR_SHOW_NAME_MAP[keyWithoutNodePrefix]
|
||||
let variableFullPathName = keyWithoutNodePrefix
|
||||
|
||||
if (isRagVariableVar(variables))
|
||||
variableFullPathName = variables.slice(2).join('.')
|
||||
|
||||
Reference in New Issue
Block a user