feat(models): add Vercel AI Gateway provider
This commit is contained in:
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user