mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 15:00:57 +03:00
Feature/Add prepend messages to memory (#2410)
add prepend messages to memory
This commit is contained in:
@@ -1306,7 +1306,8 @@ export const getSessionChatHistory = async (
|
||||
componentNodes: IComponentNodes,
|
||||
appDataSource: DataSource,
|
||||
databaseEntities: IDatabaseEntity,
|
||||
logger: any
|
||||
logger: any,
|
||||
prependMessages?: IMessage[]
|
||||
): Promise<IMessage[]> => {
|
||||
const nodeInstanceFilePath = componentNodes[memoryNode.data.name].filePath as string
|
||||
const nodeModule = await import(nodeInstanceFilePath)
|
||||
@@ -1324,7 +1325,7 @@ export const getSessionChatHistory = async (
|
||||
logger
|
||||
})
|
||||
|
||||
return (await initializedInstance.getChatMessages(sessionId)) as IMessage[]
|
||||
return (await initializedInstance.getChatMessages(sessionId, undefined, prependMessages)) as IMessage[]
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user