test: add gemini and xai parser unit tests

This commit is contained in:
B.A. Baracus 2026-04-04 17:51:38 +00:00
parent 07a544c50d
commit 988618e165
Signed by untrusted user who does not match committer: hannibal
GPG key ID: 6EB37F7E6190AF1C
4 changed files with 153 additions and 0 deletions

View file

@ -17,6 +17,15 @@ function classifyProvider(name, config) {
if (name === 'shelley-proxy') return 'shelley-proxy';
if (name === 'api-ateam') return 'api-direct';
if (config.api === 'anthropic-messages' && name.startsWith('team-')) return 'teams-direct';
// Gemini — classify by baseUrl or name
const baseUrl = (config.baseUrl || '').toLowerCase();
if (baseUrl.includes('generativelanguage.googleapis.com') || name.toLowerCase().includes('gemini')) {
return 'gemini-api';
}
// x.ai — classify by baseUrl or name
if (baseUrl.includes('x.ai') || name.toLowerCase().includes('xai') || name.toLowerCase().includes('grok')) {
return 'xai-api';
}
return null; // skip (zai, etc.)
}