Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions agents-api/src/__tests__/run/agents/ModelFactory.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,7 @@ describe('ModelFactory', () => {
model: 'unsupported/some-model',
};

expect(() => ModelFactory.createModel(config)).toThrow(
'Unsupported provider: unsupported. Supported providers are: anthropic, azure, openai, google, openrouter, gateway, nim, custom. To access other models, use OpenRouter (openrouter/model-id), Vercel AI Gateway (gateway/model-id), NVIDIA NIM (nim/model-id), or Custom OpenAI-compatible (custom/model-id).'
);
expect(() => ModelFactory.createModel(config)).toThrow('Unsupported provider: unsupported');
});

test('should handle AI Gateway configuration', () => {
Expand Down Expand Up @@ -288,7 +286,7 @@ describe('ModelFactory', () => {
};

expect(() => ModelFactory.createModel(config)).toThrow(
'Unsupported provider: unknown-provider. Supported providers are: anthropic, azure, openai, google, openrouter, gateway, nim, custom. To access other models, use OpenRouter (openrouter/model-id), Vercel AI Gateway (gateway/model-id), NVIDIA NIM (nim/model-id), or Custom OpenAI-compatible (custom/model-id).'
'Unsupported provider: unknown-provider'
);
});

Expand Down Expand Up @@ -757,7 +755,7 @@ describe('ModelFactory', () => {
describe('provider validation', () => {
test('should throw error for unsupported provider', () => {
expect(() => ModelFactory.parseModelString('unsupported-provider/some-model')).toThrow(
'Unsupported provider: unsupported-provider. Supported providers are: anthropic, azure, openai, google, openrouter, gateway, nim, custom. To access other models, use OpenRouter (openrouter/model-id), Vercel AI Gateway (gateway/model-id), NVIDIA NIM (nim/model-id), or Custom OpenAI-compatible (custom/model-id).'
'Unsupported provider: unsupported-provider'
);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,12 +314,6 @@ describe('Mock AI Provider', () => {
expect(model).toBeDefined();
});

it('should reject unsupported providers', () => {
expect(() => ModelFactory.parseModelString('unsupported/model')).toThrow(
/Unsupported provider/
);
});

it('should validate model config via validateConfig', () => {
const errors = ModelFactory.validateConfig({ model: 'mock/default' });
expect(errors).toEqual([]);
Expand Down
Loading