Description
Create comprehensive tests to ensure all API endpoints (chat, images, video, audio) consistently use the model mapping service for routing requests to providers.
Background
Recent refactoring work unified the approach to model mappings across all services. Previously, some services (video, audio) were bypassing the model mapping system and directly using the client factory. This has been fixed, but we need tests to ensure consistency is maintained.
Acceptance Criteria
Technical Details
-
Services refactored:
AudioRouter.cs - Now uses IModelProviderMappingService
VideoGenerationService.cs - Now uses IModelProviderMappingService
VideoGenerationOrchestrator.cs - Properly tracks original model alias
-
Key pattern to test:
var modelMapping = await _modelMappingService.GetMappingByModelAliasAsync(request.Model);
if (modelMapping == null)
{
throw new NotSupportedException($"Model {request.Model} is not configured");
}
var client = _clientFactory.CreateClient(modelMapping.ProviderId);
// Use modelMapping.ProviderModelName for the actual API call
Priority
Medium - Critical for maintaining architectural consistency and preventing regression
Related Issues
- Part of the usage tracking and cost calculation improvements
- Follows DRY principle requested by user
Description
Create comprehensive tests to ensure all API endpoints (chat, images, video, audio) consistently use the model mapping service for routing requests to providers.
Background
Recent refactoring work unified the approach to model mappings across all services. Previously, some services (video, audio) were bypassing the model mapping system and directly using the client factory. This has been fixed, but we need tests to ensure consistency is maintained.
Acceptance Criteria
Technical Details
Services refactored:
AudioRouter.cs- Now usesIModelProviderMappingServiceVideoGenerationService.cs- Now usesIModelProviderMappingServiceVideoGenerationOrchestrator.cs- Properly tracks original model aliasKey pattern to test:
Priority
Medium - Critical for maintaining architectural consistency and preventing regression
Related Issues