parent
91581250a7
commit
0b0cf357c5
|
|
@ -1,4 +1,4 @@
|
||||||
import { INode, INodeData, INodeOutputsValue, INodeParams } from '../../../src/Interface'
|
import { INode, INodeParams } from '../../../src/Interface'
|
||||||
import { InMemoryCache } from 'langchain/cache'
|
import { InMemoryCache } from 'langchain/cache'
|
||||||
import { getBaseClasses } from '../../../src'
|
import { getBaseClasses } from '../../../src'
|
||||||
|
|
||||||
|
|
@ -12,7 +12,6 @@ class LLMInMemoryCache implements INode {
|
||||||
category: string
|
category: string
|
||||||
baseClasses: string[]
|
baseClasses: string[]
|
||||||
inputs: INodeParams[]
|
inputs: INodeParams[]
|
||||||
outputs: INodeOutputsValue[]
|
|
||||||
inMemoryCache: any
|
inMemoryCache: any
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
|
|
@ -22,18 +21,11 @@ class LLMInMemoryCache implements INode {
|
||||||
this.type = 'LLMCache'
|
this.type = 'LLMCache'
|
||||||
this.icon = 'memorycache.png'
|
this.icon = 'memorycache.png'
|
||||||
this.category = 'LLM Cache'
|
this.category = 'LLM Cache'
|
||||||
this.baseClasses = [this.type, 'LLMCacheBase']
|
this.baseClasses = [this.type, ...getBaseClasses(InMemoryCache)]
|
||||||
this.inputs = []
|
this.inputs = []
|
||||||
this.outputs = [
|
|
||||||
{
|
|
||||||
label: 'LLM Cache',
|
|
||||||
name: 'cache',
|
|
||||||
baseClasses: [this.type, ...getBaseClasses(InMemoryCache)]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async init(nodeData: INodeData): Promise<any> {
|
async init(): Promise<any> {
|
||||||
if (!this.inMemoryCache) {
|
if (!this.inMemoryCache) {
|
||||||
this.inMemoryCache = InMemoryCache.global()
|
this.inMemoryCache = InMemoryCache.global()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue