feat(models): add Vercel AI Gateway provider

This commit is contained in:
William Valentin
2026-02-15 10:52:03 -08:00
parent a8307012f5
commit 87e942b4c5
4 changed files with 38 additions and 1 deletions
+21
View File
@@ -103,6 +103,27 @@ describe('createClientFromConfig', () => {
expect(client.constructor.name).toBe('OpenAIClient');
});
it('creates OpenAIClient for vercel provider', async () => {
const prev = process.env.AI_GATEWAY_API_KEY;
process.env.AI_GATEWAY_API_KEY = 'test-key';
try {
const { createClientFromConfig } = await loadFactory();
const client = createClientFromConfig({
provider: 'vercel',
model: 'openai/gpt-4.1',
endpoint: 'https://ai-gateway.vercel.sh/v1',
});
expect(client.constructor.name).toBe('OpenAIClient');
} finally {
if (prev === undefined) {
delete process.env.AI_GATEWAY_API_KEY;
} else {
process.env.AI_GATEWAY_API_KEY = prev;
}
}
});
it('creates OpenAIClient with Zhipu AI baseURL for zhipuai provider', async () => {
const { createClientFromConfig } = await loadFactory();
const client = createClientFromConfig({