remove returnJSONStr function
This commit is contained in:
parent
4e36be3214
commit
b6a5cd0cb3
|
|
@ -1,5 +1,5 @@
|
|||
import { ICommonObject, INode, INodeData, INodeParams, PromptTemplate } from '../../../src/Interface'
|
||||
import { getBaseClasses, getInputVariables, returnJSONStr } from '../../../src/utils'
|
||||
import { getBaseClasses, getInputVariables } from '../../../src/utils'
|
||||
import { PromptTemplateInput } from 'langchain/prompts'
|
||||
|
||||
class PromptTemplate_Prompts implements INode {
|
||||
|
|
@ -46,12 +46,11 @@ class PromptTemplate_Prompts implements INode {
|
|||
|
||||
async init(nodeData: INodeData): Promise<any> {
|
||||
const template = nodeData.inputs?.template as string
|
||||
let promptValuesStr = nodeData.inputs?.promptValues as string
|
||||
const promptValuesStr = nodeData.inputs?.promptValues as string
|
||||
|
||||
let promptValues: ICommonObject = {}
|
||||
if (promptValuesStr) {
|
||||
promptValuesStr = promptValuesStr.replace(/\s/g, '')
|
||||
promptValues = JSON.parse(returnJSONStr(promptValuesStr))
|
||||
promptValues = JSON.parse(promptValuesStr.replace(/\s/g, ''))
|
||||
}
|
||||
|
||||
const inputVariables = getInputVariables(template)
|
||||
|
|
|
|||
Loading…
Reference in New Issue