mirror of
https://github.com/langgenius/dify.git
synced 2025-10-27 00:48:43 +00:00
feat: can show rag vars
This commit is contained in:
parent
bad451d5ec
commit
025dc7c781
@ -527,7 +527,7 @@ const formatItem = (
|
|||||||
const isCurrentMatched = filterVar(v, (() => {
|
const isCurrentMatched = filterVar(v, (() => {
|
||||||
const variableArr = v.variable.split('.')
|
const variableArr = v.variable.split('.')
|
||||||
const [first] = variableArr
|
const [first] = variableArr
|
||||||
if (first === 'sys' || first === 'env' || first === 'conversation')
|
if (first === 'sys' || first === 'env' || first === 'conversation' || first === 'rag')
|
||||||
return variableArr
|
return variableArr
|
||||||
|
|
||||||
return [...selector, ...variableArr]
|
return [...selector, ...variableArr]
|
||||||
|
|||||||
@ -286,7 +286,7 @@ const VarReferenceVars: FC<Props> = ({
|
|||||||
}
|
}
|
||||||
|
|
||||||
const filteredVars = vars.filter((v) => {
|
const filteredVars = vars.filter((v) => {
|
||||||
const children = v.vars.filter(v => checkKeys([v.variable], false).isValid || v.variable.startsWith('sys.') || v.variable.startsWith('env.') || v.variable.startsWith('conversation.'))
|
const children = v.vars.filter(v => checkKeys([v.variable], false).isValid || v.variable.startsWith('sys.') || v.variable.startsWith('env.') || v.variable.startsWith('conversation.') || v.variable.startsWith('rag.'))
|
||||||
return children.length > 0
|
return children.length > 0
|
||||||
}).filter((node) => {
|
}).filter((node) => {
|
||||||
if (!searchText)
|
if (!searchText)
|
||||||
@ -297,7 +297,7 @@ const VarReferenceVars: FC<Props> = ({
|
|||||||
})
|
})
|
||||||
return children.length > 0
|
return children.length > 0
|
||||||
}).map((node) => {
|
}).map((node) => {
|
||||||
let vars = node.vars.filter(v => checkKeys([v.variable], false).isValid || v.variable.startsWith('sys.') || v.variable.startsWith('env.') || v.variable.startsWith('conversation.'))
|
let vars = node.vars.filter(v => checkKeys([v.variable], false).isValid || v.variable.startsWith('sys.') || v.variable.startsWith('env.') || v.variable.startsWith('conversation.') || v.variable.startsWith('rag.'))
|
||||||
if (searchText) {
|
if (searchText) {
|
||||||
const searchTextLower = searchText.toLowerCase()
|
const searchTextLower = searchText.toLowerCase()
|
||||||
if (!node.title.toLowerCase().includes(searchTextLower))
|
if (!node.title.toLowerCase().includes(searchTextLower))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user