## Translation Files - Add 11 new language files (es, de, pt, ru, zh, ja, ko, ar, hi, nl, pl) - Add 100+ missing translation keys across all 15 languages - New sections: notebook, pagination, ai.batchOrganization, ai.autoLabels - Update nav section with workspace, quickAccess, myLibrary keys ## Component Updates - Update 15+ components to use translation keys instead of hardcoded text - Components: notebook dialogs, sidebar, header, note-input, ghost-tags, etc. - Replace 80+ hardcoded English/French strings with t() calls - Ensure consistent UI across all supported languages ## Code Quality - Remove 77+ console.log statements from codebase - Clean up API routes, components, hooks, and services - Keep only essential error handling (no debugging logs) ## UI/UX Improvements - Update Keep logo to yellow post-it style (from-yellow-400 to-amber-500) - Change selection colors to #FEF3C6 (notebooks) and #EFB162 (nav items) - Make "+" button permanently visible in notebooks section - Fix grammar and syntax errors in multiple components ## Bug Fixes - Fix JSON syntax errors in it.json, nl.json, pl.json, zh.json - Fix syntax errors in notebook-suggestion-toast.tsx - Fix syntax errors in use-auto-tagging.ts - Fix syntax errors in paragraph-refactor.service.ts - Fix duplicate "fusion" section in nl.json 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> Ou une version plus courte si vous préférez : feat(i18n): Add 15 languages, remove logs, update UI components - Create 11 new translation files (es, de, pt, ru, zh, ja, ko, ar, hi, nl, pl) - Add 100+ translation keys: notebook, pagination, AI features - Update 15+ components to use translations (80+ strings) - Remove 77+ console.log statements from codebase - Fix JSON syntax errors in 4 translation files - Fix component syntax errors (toast, hooks, services) - Update logo to yellow post-it style - Change selection colors (#FEF3C6, #EFB162) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
97 lines
2.7 KiB
TypeScript
97 lines
2.7 KiB
TypeScript
import { NextRequest, NextResponse } from 'next/server'
|
|
import { getSystemConfig } from '@/lib/config'
|
|
|
|
// Modèles populaires pour chaque provider (2025)
|
|
const PROVIDER_MODELS = {
|
|
ollama: {
|
|
tags: [
|
|
'llama3:latest',
|
|
'llama3.2:latest',
|
|
'granite4:latest',
|
|
'mistral:latest',
|
|
'mixtral:latest',
|
|
'phi3:latest',
|
|
'gemma2:latest',
|
|
'qwen2:latest'
|
|
],
|
|
embeddings: [
|
|
'embeddinggemma:latest',
|
|
'mxbai-embed-large:latest',
|
|
'nomic-embed-text:latest'
|
|
]
|
|
},
|
|
openai: {
|
|
tags: [
|
|
'gpt-4o',
|
|
'gpt-4o-mini',
|
|
'gpt-4-turbo',
|
|
'gpt-4',
|
|
'gpt-3.5-turbo'
|
|
],
|
|
embeddings: [
|
|
'text-embedding-3-small',
|
|
'text-embedding-3-large',
|
|
'text-embedding-ada-002'
|
|
]
|
|
},
|
|
custom: {
|
|
tags: [], // Will be loaded dynamically
|
|
embeddings: [] // Will be loaded dynamically
|
|
}
|
|
}
|
|
|
|
export async function GET(request: NextRequest) {
|
|
try {
|
|
const config = await getSystemConfig()
|
|
const provider = (config.AI_PROVIDER || 'ollama').toLowerCase()
|
|
|
|
let models = PROVIDER_MODELS[provider as keyof typeof PROVIDER_MODELS] || { tags: [], embeddings: [] }
|
|
|
|
// Pour Ollama, essayer de récupérer la liste réelle depuis l'API locale
|
|
if (provider === 'ollama') {
|
|
try {
|
|
const ollamaBaseUrl = config.OLLAMA_BASE_URL || process.env.OLLAMA_BASE_URL || 'http://localhost:11434'
|
|
const response = await fetch(`${ollamaBaseUrl}/api/tags`, {
|
|
method: 'GET',
|
|
headers: { 'Content-Type': 'application/json' }
|
|
})
|
|
|
|
if (response.ok) {
|
|
const data = await response.json()
|
|
const allModels = data.models || []
|
|
|
|
// Séparer les modèles de tags et d'embeddings
|
|
const tagModels = allModels
|
|
.filter((m: any) => !m.name.includes('embed') && !m.name.includes('Embedding'))
|
|
.map((m: any) => m.name)
|
|
.slice(0, 20) // Limiter à 20 modèles
|
|
|
|
const embeddingModels = allModels
|
|
.filter((m: any) => m.name.includes('embed') || m.name.includes('Embedding'))
|
|
.map((m: any) => m.name)
|
|
|
|
models = {
|
|
tags: tagModels.length > 0 ? tagModels : models.tags,
|
|
embeddings: embeddingModels.length > 0 ? embeddingModels : models.embeddings
|
|
}
|
|
}
|
|
} catch (error) {
|
|
// Garder les modèles par défaut
|
|
}
|
|
}
|
|
|
|
return NextResponse.json({
|
|
provider,
|
|
models: models || { tags: [], embeddings: [] }
|
|
})
|
|
} catch (error: any) {
|
|
return NextResponse.json(
|
|
{
|
|
error: error.message || 'Failed to fetch models',
|
|
models: { tags: [], embeddings: [] }
|
|
},
|
|
{ status: 500 }
|
|
)
|
|
}
|
|
}
|