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
commit 12435774ca
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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