diff --git a/src/app/api/models/route.ts b/src/app/api/models/route.ts index 9563d188..cd43b6b9 100644 --- a/src/app/api/models/route.ts +++ b/src/app/api/models/route.ts @@ -802,15 +802,15 @@ async function fetchWaveSpeedModels(apiKey: string): Promise { // ============ Fal.ai Helpers ============ +const FAL_AUDIO_CATEGORIES: Record = { + "text-to-speech": "text-to-audio", + "text-to-music": "text-to-audio", + "text-to-sound-effects": "text-to-audio", +}; + function mapFalCategory(category: string): ModelCapability | null { - if (category === "text-to-speech") { - return "text-to-audio"; - } - if (category === "text-to-music") { - return "text-to-audio"; - } - if (category === "text-to-sound-effects") { - return "text-to-audio"; + if (category in FAL_AUDIO_CATEGORIES) { + return FAL_AUDIO_CATEGORIES[category]; } if (RELEVANT_CATEGORIES.includes(category)) { return category as ModelCapability;