()
| 24 | } |
| 25 | |
| 26 | export async function initializeSemanticCache() { |
| 27 | if (config.useSemanticCache) { |
| 28 | const index = new Index(); |
| 29 | semanticCache = new SemanticCache({ index, minProximity: 0.95 }); |
| 30 | } |
| 31 | } |
| 32 | export async function getFromSemanticCache(userMessage: string) { |
| 33 | if (semanticCache) { |
| 34 | return semanticCache.get(userMessage); |