INNER CODE UNIT · JavaScript
ModelLoader
Zaki-1052/GPTPortal · src/shared/modelLoader.js:43
class ModelLoader {
constructor() {
this.models = null;
this.categories = null;
this.lastLoad = null;
this.lastSync = null;
this.jsonPath = path.join(__dirname, '../../public/js/data/models.json');
this.syncInterval = 24 * 60 * 60 * 1000; // 24 hours
}
/**
* Load models from unified JSON file
* @returns {Promise<Object>} Models and categories
*/
async loadModels() {
try {
// Check if we have cached data
if (this.models && this.categories) {