Spaces:
Configuration error
Configuration error
File size: 812 Bytes
d613519 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | /**
* Model Fallback Configuration
*
* Defines fallback mappings for when a model's quota is exhausted across all accounts.
* Enables graceful degradation to alternative models with similar capabilities.
*/
import { MODEL_FALLBACK_MAP } from './constants.js';
// Re-export for convenience
export { MODEL_FALLBACK_MAP };
/**
* Get fallback model for a given model ID
* @param {string} model - Primary model ID
* @returns {string|null} Fallback model ID or null if no fallback exists
*/
export function getFallbackModel(model) {
return MODEL_FALLBACK_MAP[model] || null;
}
/**
* Check if a model has a fallback configured
* @param {string} model - Model ID to check
* @returns {boolean} True if fallback exists
*/
export function hasFallback(model) {
return model in MODEL_FALLBACK_MAP;
}
|