Merge pull request #1070 from yavisht/update-fromPromptMessages-function

fix: ChatPromptTemplate function name
This commit is contained in:
Henry Heng
2023-10-16 11:45:27 +01:00
committed by GitHub
2 changed files with 2 additions and 2 deletions
@@ -90,7 +90,7 @@ class ConversationChain_Chains implements INode {
verbose: process.env.DEBUG === 'true' ? true : false verbose: process.env.DEBUG === 'true' ? true : false
} }
const chatPrompt = ChatPromptTemplate.fromPromptMessages([ const chatPrompt = ChatPromptTemplate.fromMessages([
SystemMessagePromptTemplate.fromTemplate(prompt ? `${prompt}\n${systemMessage}` : systemMessage), SystemMessagePromptTemplate.fromTemplate(prompt ? `${prompt}\n${systemMessage}` : systemMessage),
new MessagesPlaceholder(memory.memoryKey ?? 'chat_history'), new MessagesPlaceholder(memory.memoryKey ?? 'chat_history'),
HumanMessagePromptTemplate.fromTemplate('{input}') HumanMessagePromptTemplate.fromTemplate('{input}')
@@ -53,7 +53,7 @@ class ChatPromptTemplate_Prompts implements INode {
const humanMessagePrompt = nodeData.inputs?.humanMessagePrompt as string const humanMessagePrompt = nodeData.inputs?.humanMessagePrompt as string
const promptValuesStr = nodeData.inputs?.promptValues as string const promptValuesStr = nodeData.inputs?.promptValues as string
const prompt = ChatPromptTemplate.fromPromptMessages([ const prompt = ChatPromptTemplate.fromMessages([
SystemMessagePromptTemplate.fromTemplate(systemMessagePrompt), SystemMessagePromptTemplate.fromTemplate(systemMessagePrompt),
HumanMessagePromptTemplate.fromTemplate(humanMessagePrompt) HumanMessagePromptTemplate.fromTemplate(humanMessagePrompt)
]) ])