Removing InMemoryCache and code cleanup in MomentoCache

This commit is contained in:
vinodkiran
2023-10-08 23:03:00 +05:30
parent 7d4337724d
commit 644bd09ef2
3 changed files with 0 additions and 37 deletions
@@ -1,36 +0,0 @@
import { INode, INodeParams } from '../../../src/Interface'
import { InMemoryCache as LangchainInMemoryCache } from 'langchain/cache'
import { getBaseClasses } from '../../../src'
class InMemoryCache implements INode {
label: string
name: string
version: number
description: string
type: string
icon: string
category: string
baseClasses: string[]
inputs: INodeParams[]
inMemoryCache: any
constructor() {
this.label = 'Local (Builtin) Cache'
this.name = 'localCache'
this.version = 1.0
this.type = 'Cache'
this.icon = 'memorycache.png'
this.category = 'Cache'
this.baseClasses = [this.type, ...getBaseClasses(InMemoryCache)]
this.inputs = []
}
async init(): Promise<any> {
if (!this.inMemoryCache) {
this.inMemoryCache = LangchainInMemoryCache.global()
}
return this.inMemoryCache
}
}
module.exports = { nodeClass: InMemoryCache }
Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

@@ -36,7 +36,6 @@ class MomentoCache implements INode {
const credentialData = await getCredentialData(nodeData.credential ?? '', options)
const apiKey = getCredentialParam('momentoApiKey', credentialData, nodeData)
const cacheName = getCredentialParam('momentoCache', credentialData, nodeData)
const endPoint = getCredentialParam('momentoEndpoint', credentialData, nodeData)
// See https://github.com/momentohq/client-sdk-javascript for connection options
const client = new CacheClient({