mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-29 05:01:10 +03:00
Bugfix/Escape JSON in Prompt Message (#3901)
add fix to only get variables when there is no colon
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { ICommonObject, INode, INodeData, INodeParams, PromptTemplate } from '../../../src/Interface'
|
||||
import { getBaseClasses, getInputVariables } from '../../../src/utils'
|
||||
import { getBaseClasses, getInputVariables, transformBracesWithColon } from '../../../src/utils'
|
||||
import { PromptTemplateInput } from '@langchain/core/prompts'
|
||||
|
||||
class PromptTemplate_Prompts implements INode {
|
||||
@@ -42,7 +42,7 @@ class PromptTemplate_Prompts implements INode {
|
||||
}
|
||||
|
||||
async init(nodeData: INodeData): Promise<any> {
|
||||
const template = nodeData.inputs?.template as string
|
||||
let template = nodeData.inputs?.template as string
|
||||
const promptValuesStr = nodeData.inputs?.promptValues
|
||||
|
||||
let promptValues: ICommonObject = {}
|
||||
@@ -55,6 +55,7 @@ class PromptTemplate_Prompts implements INode {
|
||||
}
|
||||
|
||||
const inputVariables = getInputVariables(template)
|
||||
template = transformBracesWithColon(template)
|
||||
|
||||
try {
|
||||
const options: PromptTemplateInput = {
|
||||
|
||||
Reference in New Issue
Block a user