chore: Add chat history display name mapping for workflow variables

This commit is contained in:
zhsama
2026-02-09 23:24:05 +08:00
parent cce7970f77
commit a71f336ee0
2 changed files with 5 additions and 2 deletions

View File

@@ -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 = `{

View File

@@ -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('.')