mirror of
https://github.com/teamchong/pxpipe.git
synced 2026-07-22 02:02:51 +02:00
7e48713b4e
Add native Google AI Studio transformation, measured token accounting, dashboard support, and a production 312×728 profile for Gemini 3.6 Flash. Gemini uses 26% fewer vision tokens than Fable 5 per full page and matches or exceeds Fable across the production-profile quality suite.
45 lines
1.7 KiB
TypeScript
45 lines
1.7 KiB
TypeScript
/**
|
|
* Unit tests for Gemini model profiles, identification, and vision token pricing.
|
|
*/
|
|
import { describe, expect, it } from 'vitest';
|
|
import {
|
|
isGeminiModel,
|
|
resolveGeminiProfile,
|
|
geminiVisionTokens,
|
|
GEMINI_3_6_FLASH_PROFILE,
|
|
} from '../src/core/gemini-model-profiles.js';
|
|
import { visionTokensForModel } from '../src/core/openai.js';
|
|
import { resolveGptProfile } from '../src/core/gpt-model-profiles.js';
|
|
|
|
describe('Gemini Model Profiles & Identification', () => {
|
|
it('correctly identifies Gemini family model strings', () => {
|
|
expect(isGeminiModel('gemini-3.6-flash')).toBe(true);
|
|
expect(isGeminiModel('google/gemini-3.6-flash')).toBe(true);
|
|
expect(isGeminiModel('GEMINI-PRO')).toBe(false);
|
|
expect(isGeminiModel('gpt-5.6-sol')).toBe(false);
|
|
expect(isGeminiModel('claude-fable-5')).toBe(false);
|
|
expect(isGeminiModel('grok-4.5')).toBe(false);
|
|
});
|
|
|
|
it('resolves dedicated Gemini profile via resolveGeminiProfile and resolveGptProfile', () => {
|
|
const prof1 = resolveGeminiProfile();
|
|
expect(prof1).toBe(GEMINI_3_6_FLASH_PROFILE);
|
|
expect(prof1.stripCols).toBe(312);
|
|
expect(prof1.maxHeightPx).toBe(728);
|
|
expect(prof1.vision.base).toBe(1078);
|
|
expect(prof1.style.font).toBe('spleen-5x8');
|
|
|
|
const prof2 = resolveGptProfile('google/gemini-3.6-flash');
|
|
expect(prof2.stripCols).toBe(312);
|
|
expect(prof2.maxHeightPx).toBe(728);
|
|
expect(prof2.vision.base).toBe(1078);
|
|
});
|
|
|
|
it('uses the measured production-geometry image cost', () => {
|
|
expect(geminiVisionTokens('gemini-3.6-flash', 1568, 728)).toBe(1078);
|
|
|
|
expect(visionTokensForModel('gemini-3.6-flash', 1568, 728)).toBe(1078);
|
|
expect(visionTokensForModel('google/gemini-3.6-flash', 1568, 728)).toBe(1078);
|
|
});
|
|
});
|