Add option to auto-adjust number of chroma messages to keep / query based on context size.

This commit is contained in:
Cohee
2023-06-18 16:29:23 +03:00
parent 58a6ccd4a5
commit 22a5def618
3 changed files with 82 additions and 9 deletions

View File

@ -422,12 +422,12 @@ async function loadExtensionSettings(settings) {
}
}
async function runGenerationInterceptors(chat) {
async function runGenerationInterceptors(chat, contextSize) {
for (const manifest of Object.values(manifests)) {
const interceptorKey = manifest.generate_interceptor;
if (typeof window[interceptorKey] === 'function') {
try {
await window[interceptorKey](chat);
await window[interceptorKey](chat, contextSize);
} catch (e) {
console.error(`Failed running interceptor for ${manifest.display_name}`, e);
}