Mantis summary updates.

This commit is contained in:
Cameron Redmore 2025-04-26 10:53:07 +01:00
parent 0e0d1bffb3
commit af8cc56e79
7 changed files with 168 additions and 16 deletions

View file

@ -5,9 +5,17 @@ import { getSetting } from './settings.js';
const model = 'gemini-2.0-flash';
const geminiResponseCache = new Map();
export async function askGemini(content)
{
// Check if the content is already cached
if (geminiResponseCache.has(content))
{
return geminiResponseCache.get(content);
}
const GOOGLE_API_KEY = await getSetting('GEMINI_API_KEY');
if (!GOOGLE_API_KEY)
@ -34,6 +42,9 @@ export async function askGemini(content)
}
});
// Cache the response
geminiResponseCache.set(content, response.text);
return response.text;
}
catch (error)