Refactoring of LLM In Cache Memory files for better clarity of name

This commit is contained in:
vinodkiran
2023-09-30 12:05:51 +05:30
parent d81869fd59
commit 18702e4c47
2 changed files with 2 additions and 2 deletions
@@ -0,0 +1,44 @@
import { INode, INodeData, INodeOutputsValue, INodeParams } from '../../../src/Interface'
import { InMemoryCache } from 'langchain/cache'
import { getBaseClasses } from '../../../src'
class LLMInMemoryCache implements INode {
label: string
name: string
version: number
description: string
type: string
icon: string
category: string
baseClasses: string[]
inputs: INodeParams[]
outputs: INodeOutputsValue[]
inMemoryCache: any
constructor() {
this.label = 'Local (Builtin) Cache'
this.name = 'localCache'
this.version = 1.0
this.type = 'LLMCache'
this.icon = 'memorycache.png'
this.category = 'LLM Cache'
this.baseClasses = [this.type, 'LLMCacheBase']
this.inputs = []
this.outputs = [
{
label: 'LLM Cache',
name: 'cache',
baseClasses: [this.type, ...getBaseClasses(InMemoryCache)]
}
]
}
async init(nodeData: INodeData): Promise<any> {
if (!this.inMemoryCache) {
this.inMemoryCache = InMemoryCache.global()
}
return this.inMemoryCache
}
}
module.exports = { nodeClass: LLMInMemoryCache }
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB