feat: add multi-key auth profile rotation for model providers
This commit is contained in:
@@ -28,6 +28,16 @@ describe('createClientFromConfig', () => {
|
||||
expect(client.constructor.name).toBe('AnthropicClient');
|
||||
});
|
||||
|
||||
it('creates RotatingModelClient for anthropic when api_keys are provided', async () => {
|
||||
const { createClientFromConfig } = await loadFactory();
|
||||
const client = createClientFromConfig({
|
||||
provider: 'anthropic',
|
||||
model: 'claude-sonnet-4-5-20250514',
|
||||
api_keys: ['sk-ant-1', 'sk-ant-2'],
|
||||
});
|
||||
expect(client.constructor.name).toBe('RotatingModelClient');
|
||||
});
|
||||
|
||||
it('creates OpenAIClient for openai provider', async () => {
|
||||
const { createClientFromConfig } = await loadFactory();
|
||||
const client = createClientFromConfig({
|
||||
@@ -38,6 +48,16 @@ describe('createClientFromConfig', () => {
|
||||
expect(client.constructor.name).toBe('OpenAIClient');
|
||||
});
|
||||
|
||||
it('creates RotatingModelClient for openai when api_keys are provided', async () => {
|
||||
const { createClientFromConfig } = await loadFactory();
|
||||
const client = createClientFromConfig({
|
||||
provider: 'openai',
|
||||
model: 'gpt-4o',
|
||||
api_keys: ['sk-1', 'sk-2'],
|
||||
});
|
||||
expect(client.constructor.name).toBe('RotatingModelClient');
|
||||
});
|
||||
|
||||
it('creates OllamaClient for ollama provider', async () => {
|
||||
const { createClientFromConfig } = await loadFactory();
|
||||
const client = createClientFromConfig({
|
||||
|
||||
Reference in New Issue
Block a user