mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 21:00:58 +03:00
- update LangchainJS version
- add types & interfaces - small ui bug fix - update marketplace files
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { INode, INodeData, INodeParams } from '../../../src/Interface'
|
||||
import { getBaseClasses } from '../../../src/utils'
|
||||
import { BufferMemory } from 'langchain/memory'
|
||||
|
||||
class BufferMemory_Memory implements INode {
|
||||
label: string
|
||||
@@ -17,7 +18,8 @@ class BufferMemory_Memory implements INode {
|
||||
this.type = 'BufferMemory'
|
||||
this.icon = 'memory.svg'
|
||||
this.category = 'Memory'
|
||||
this.description = 'Perform calculations on response'
|
||||
this.description = 'Remembers previous conversational back and forths directly'
|
||||
this.baseClasses = [this.type, ...getBaseClasses(BufferMemory)]
|
||||
this.inputs = [
|
||||
{
|
||||
label: 'Memory Key',
|
||||
@@ -34,13 +36,7 @@ class BufferMemory_Memory implements INode {
|
||||
]
|
||||
}
|
||||
|
||||
async getBaseClasses(): Promise<string[]> {
|
||||
const { BufferMemory } = await import('langchain/memory')
|
||||
return getBaseClasses(BufferMemory)
|
||||
}
|
||||
|
||||
async init(nodeData: INodeData): Promise<any> {
|
||||
const { BufferMemory } = await import('langchain/memory')
|
||||
const memoryKey = nodeData.inputs?.memoryKey as string
|
||||
const inputKey = nodeData.inputs?.inputKey as string
|
||||
return new BufferMemory({
|
||||
|
||||
Reference in New Issue
Block a user