Mantis summary updates.
This commit is contained in:
parent
0e0d1bffb3
commit
af8cc56e79
7 changed files with 168 additions and 16 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue