feat: query prompt template support in chatflow (#3791)

Co-authored-by: Joel <iamjoel007@gmail.com>
This commit is contained in:
takatost
2024-04-25 18:01:53 +08:00
committed by GitHub
parent 80b9507e7a
commit 12435774ca
12 changed files with 113 additions and 18 deletions

View File

@@ -30,6 +30,9 @@ export const checkHasQueryBlock = (text: string) => {
* {{#1711617514996.sys.query#}} => [sys, query]
*/
export const getInputVars = (text: string): ValueSelector[] => {
if (!text)
return []
const allVars = text.match(/{{#([^#]*)#}}/g)
if (allVars && allVars?.length > 0) {
// {{#context#}}, {{#query#}} is not input vars