mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 15:00:57 +03:00
Feat/update ollama for function calling (#2892)
update ollama for function calling
This commit is contained in:
@@ -111,6 +111,7 @@ const initializeMongoDB = async (nodeData: INodeData, options: ICommonObject): P
|
||||
sessionId
|
||||
})
|
||||
|
||||
// @ts-ignore
|
||||
mongoDBChatMessageHistory.getMessages = async (): Promise<BaseMessage[]> => {
|
||||
const document = await collection.findOne({
|
||||
sessionId: (mongoDBChatMessageHistory as any).sessionId
|
||||
@@ -119,6 +120,7 @@ const initializeMongoDB = async (nodeData: INodeData, options: ICommonObject): P
|
||||
return messages.map(mapStoredMessageToChatMessage)
|
||||
}
|
||||
|
||||
// @ts-ignore
|
||||
mongoDBChatMessageHistory.addMessage = async (message: BaseMessage): Promise<void> => {
|
||||
const messages = [message].map((msg) => msg.toDict())
|
||||
await collection.updateOne(
|
||||
@@ -136,6 +138,7 @@ const initializeMongoDB = async (nodeData: INodeData, options: ICommonObject): P
|
||||
|
||||
return new BufferMemoryExtended({
|
||||
memoryKey: memoryKey ?? 'chat_history',
|
||||
// @ts-ignore
|
||||
chatHistory: mongoDBChatMessageHistory,
|
||||
sessionId,
|
||||
collection
|
||||
|
||||
Reference in New Issue
Block a user