mirror of
https://github.com/lWolvesl/antigravity-usage-monitor.git
synced 2026-11-26 17:09:28 +08:00
feat(context): add 384k (384,000 token) context window preset option
Closes #24
This commit is contained in:
@@ -77,7 +77,7 @@ export function getContextWindowGroups(models) {
|
||||
}));
|
||||
const capacity = Math.min(...members.map((member) => member.capacity));
|
||||
if (!options.length && capacity) {
|
||||
for (const tokens of new Set([128000, 256000, 512000, 768000, 900000, capacity])) {
|
||||
for (const tokens of new Set([128000, 256000, 384000, 512000, 768000, 900000, capacity])) {
|
||||
if (tokens <= capacity && !options.some(({ name }) => name === String(tokens))) {
|
||||
options.push({ name: String(tokens), tokens });
|
||||
}
|
||||
|
||||
@@ -46,9 +46,11 @@ test('saves and restores one model at a time using host presets or verified mode
|
||||
assert.equal(carbonModel.id, carbonGroup);
|
||||
assert.equal(carbonModel.label, 'Gemini 4 Carbon');
|
||||
assert.deepEqual(carbonModel.members, [carbon, carbonLow]);
|
||||
assert.equal(carbonModel.options.at(-1).tokens, 636000);
|
||||
assert.deepEqual(carbonModel.options.map(({ tokens }) => tokens), [128000, 256000, 384000, 512000, 636000]);
|
||||
assert.equal((await update({ modelId: carbonGroup, option: '768000' })).status, 400);
|
||||
h.state.settings.modelContextWindows = { [carbon]: '768000', [carbonLow]: '256000' };
|
||||
assert.equal((await update({ modelId: carbonGroup, option: '384000' })).status, 200);
|
||||
assert.deepEqual({ ...h.loadSettings().modelContextWindows }, { [carbonGroup]: '384000' });
|
||||
assert.equal((await update({ modelId: carbonGroup, option: '512000' })).status, 200);
|
||||
assert.deepEqual({ ...h.loadSettings().modelContextWindows }, { [carbonGroup]: '512000' });
|
||||
assert.equal((await update({ modelId: carbonGroup, option: null })).status, 200);
|
||||
|
||||
Reference in New Issue
Block a user