mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-29 15:01:11 +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, getCredentialData, getCredentialParam, getInputVariables } from '../../../src/utils'
|
||||
import { getBaseClasses, getCredentialData, getCredentialParam, getInputVariables, transformBracesWithColon } from '../../../src/utils'
|
||||
import { PromptTemplateInput } from '@langchain/core/prompts'
|
||||
import { Langfuse } from 'langfuse'
|
||||
|
||||
@@ -64,7 +64,7 @@ class PromptLangfuse_Prompts implements INode {
|
||||
})
|
||||
|
||||
const langfusePrompt = await langfuse.getPrompt(nodeData.inputs?.template as string)
|
||||
const template = langfusePrompt.getLangchainPrompt()
|
||||
let template = langfusePrompt.getLangchainPrompt()
|
||||
|
||||
const promptValuesStr = nodeData.inputs?.promptValues
|
||||
|
||||
@@ -78,6 +78,7 @@ class PromptLangfuse_Prompts implements INode {
|
||||
}
|
||||
|
||||
const inputVariables = getInputVariables(template)
|
||||
template = transformBracesWithColon(template)
|
||||
|
||||
try {
|
||||
const options: PromptTemplateInput = {
|
||||
|
||||
Reference in New Issue
Block a user