From 0a49234a16144e3f2b609d4ae8199c57d1b6fe4d Mon Sep 17 00:00:00 2001 From: chungyau97 Date: Thu, 27 Jul 2023 14:08:33 +0800 Subject: [PATCH] remove curly bracket in loaded document text --- .../nodes/chains/ConversationChain/ConversationChain.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/components/nodes/chains/ConversationChain/ConversationChain.ts b/packages/components/nodes/chains/ConversationChain/ConversationChain.ts index 7b6f002d..d5b282c7 100644 --- a/packages/components/nodes/chains/ConversationChain/ConversationChain.ts +++ b/packages/components/nodes/chains/ConversationChain/ConversationChain.ts @@ -77,6 +77,9 @@ class ConversationChain_Chains implements INode { finalText += finalDocs[i].pageContent } + const replaceChar: string[] = ['{', '}'] + for (const char of replaceChar) finalText = finalText.replaceAll(char, '') + if (finalText) systemMessage = `${systemMessage}\nThe AI has the following context:\n${finalText}` const obj: any = {