mirror of
https://github.com/langgenius/dify.git
synced 2026-05-06 10:28:10 +08:00
refactor: Update variable syntax to support agent context markers
Extend variable pattern matching to support both `#` and `@` markers, with `@` specifically used for agent context variables. Update regex patterns, text processing logic, and add sub-graph persistence for agent variable handling.
This commit is contained in:
@ -340,7 +340,7 @@ Thought: {{agent_scratchpad}}
|
||||
}
|
||||
|
||||
export const VAR_REGEX
|
||||
= /\{\{(#[\w-]{1,50}(\.\d+)?(\.[a-z_]\w{0,29}){1,10}#)\}\}/gi
|
||||
= /\{\{([#@])[\w-]{1,50}(\.\d+)?(\.[a-z_]\w{0,29}){1,10}\1\}\}/gi
|
||||
|
||||
export const resetReg = () => (VAR_REGEX.lastIndex = 0)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user