MCPcopy
hub / github.com/FlowiseAI/Flowise / getLLMCache

Method getLLMCache

packages/server/src/CachePool.ts:145–157  ·  view source on GitHub ↗

* Get item from llm cache pool * @param {string} chatflowid

(chatflowid: string)

Source from the content-addressed store, hash-verified

143 * @param {string} chatflowid
144 */
145 async getLLMCache(chatflowid: string): Promise<Map<any, any> | undefined> {
146 if (process.env.MODE === MODE.QUEUE) {
147 if (this.redisClient) {
148 const serializedValue = await this.redisClient.get(`llmCache:${chatflowid}`)
149 if (serializedValue) {
150 return new Map(JSON.parse(serializedValue))
151 }
152 }
153 } else {
154 return this.activeLLMCache[chatflowid]
155 }
156 return undefined
157 }
158
159 /**
160 * Get item from embedding cache pool

Callers 1

initMethod · 0.80

Calls 2

parseMethod · 0.65
getMethod · 0.45

Tested by

no test coverage detected