diff --git a/packages/components/nodes/memory/RedisBackedChatMemory/RedisBackedChatMemory.ts b/packages/components/nodes/memory/RedisBackedChatMemory/RedisBackedChatMemory.ts index c60b9431fb2..82d80bb3591 100644 --- a/packages/components/nodes/memory/RedisBackedChatMemory/RedisBackedChatMemory.ts +++ b/packages/components/nodes/memory/RedisBackedChatMemory/RedisBackedChatMemory.ts @@ -158,25 +158,25 @@ class BufferMemoryExtended extends FlowiseMemory implements MemoryMethods { } async addChatMessages(msgArray: { text: string; type: MessageType }[], overrideSessionId = ''): Promise { - await this.withRedisClient(async (client) => { - const id = overrideSessionId ? overrideSessionId : this.sessionId - const input = msgArray.find((msg) => msg.type === 'userMessage') - const output = msgArray.find((msg) => msg.type === 'apiMessage') - - if (input) { - const newInputMessage = new HumanMessage(input.text) - const messageToAdd = [newInputMessage].map((msg) => msg.toDict()) - await client.lpush(id, JSON.stringify(messageToAdd[0])) - if (this.sessionTTL) await client.expire(id, this.sessionTTL) - } - - if (output) { - const newOutputMessage = new AIMessage(output.text) - const messageToAdd = [newOutputMessage].map((msg) => msg.toDict()) - await client.lpush(id, JSON.stringify(messageToAdd[0])) - if (this.sessionTTL) await client.expire(id, this.sessionTTL) - } - }) + // await this.withRedisClient(async (client) => { + // const id = overrideSessionId ? overrideSessionId : this.sessionId + // const input = msgArray.find((msg) => msg.type === 'userMessage') + // const output = msgArray.find((msg) => msg.type === 'apiMessage') + + // if (input) { + // const newInputMessage = new HumanMessage(input.text) + // const messageToAdd = [newInputMessage].map((msg) => msg.toDict()) + // await client.lpush(id, JSON.stringify(messageToAdd[0])) + // if (this.sessionTTL) await client.expire(id, this.sessionTTL) + // } + + // if (output) { + // const newOutputMessage = new AIMessage(output.text) + // const messageToAdd = [newOutputMessage].map((msg) => msg.toDict()) + // await client.lpush(id, JSON.stringify(messageToAdd[0])) + // if (this.sessionTTL) await client.expire(id, this.sessionTTL) + // } + // }) } async clearChatMessages(overrideSessionId = ''): Promise {