update model list
Browse filesFiles changed (2)
35 unmodified lines36373839404135 unmodified linesconst [isResizingSettings, setIsResizingSettings] = useState(false);const [isDesktop, setIsDesktop] = useState(false);// Load messages from localStorage on mount (client-side only to avoid hydration issues)useEffect(() => {if (typeof window !== 'undefined') {35 unmodified lines36373839404142434445464748495035 unmodified linesconst [isResizingSettings, setIsResizingSettings] = useState(false);const [isDesktop, setIsDesktop] = useState(false);// Clear cache on app startup to ensure fresh datauseEffect(() => {if (typeof window !== 'undefined') {console.log('[Cache] Clearing models and languages cache on app startup');localStorage.removeItem('anycoder_models');localStorage.removeItem('anycoder_languages');}}, []); // Run once on mount// Load messages from localStorage on mount (client-side only to avoid hydration issues)useEffect(() => {if (typeof window !== 'undefined') {
149 unmodified lines1501511521531541551568 unmodified lines16516616716816917017126 unmodified lines1981992002012022032048 unmodified lines213214215216217218219149 unmodified lines}async getModels(): Promise<Model[]> {// Check cache first (24 hour TTL)const cached = this.getCachedData<Model[]>('anycoder_models', 24 * 60 * 60 * 1000);if (cached) {console.log('Using cached models:', cached.length, 'models');8 unmodified lines// Cache the successful responseif (models && models.length > 0) {this.setCachedData('anycoder_models', models);console.log('Cached', models.length, 'models');}return models;26 unmodified lines}async getLanguages(): Promise<{ languages: Language[] }> {// Check cache first (24 hour TTL)const cached = this.getCachedData<Language[]>('anycoder_languages', 24 * 60 * 60 * 1000);if (cached) {console.log('Using cached languages:', cached.length, 'languages');8 unmodified lines// Cache the successful responseif (languages && languages.length > 0) {this.setCachedData('anycoder_languages', languages);console.log('Cached', languages.length, 'languages');}return response.data;149 unmodified lines1501511521531541551568 unmodified lines16516616716816917017126 unmodified lines1981992002012022032048 unmodified lines213214215216217218219149 unmodified lines}async getModels(): Promise<Model[]> {// Check cache first (24 hour TTL - cache once per day)const cached = this.getCachedData<Model[]>('anycoder_models', 24 * 60 * 60 * 1000);if (cached) {console.log('Using cached models:', cached.length, 'models');8 unmodified lines// Cache the successful responseif (models && models.length > 0) {this.setCachedData('anycoder_models', models);console.log('Cached', models.length, 'models (valid for 24 hours)');}return models;26 unmodified lines}async getLanguages(): Promise<{ languages: Language[] }> {// Check cache first (24 hour TTL - cache once per day)const cached = this.getCachedData<Language[]>('anycoder_languages', 24 * 60 * 60 * 1000);if (cached) {console.log('Using cached languages:', cached.length, 'languages');8 unmodified lines// Cache the successful responseif (languages && languages.length > 0) {this.setCachedData('anycoder_languages', languages);console.log('Cached', languages.length, 'languages (valid for 24 hours)');}return response.data;
frontend/src/app/page.tsx+9
frontend/src/lib/api.ts+4-4