que DeepSite accepte le projet
Browse filesque l’utilisateur comprenne quoi faire
que ton espace codage soit professionnel comme Builder / Manus
✅ 1️⃣ VERSION UI (courte – affichée dans l’interface)
Texte
Ollama nécessite une instance locale active pour fonctionner.
Code (UI)
<div class="ai-warning ui">
Ollama nécessite une instance locale active pour fonctionner.
</div>
✅ 2️⃣ VERSION PRODUIT (rassurante – entreprise)
Texte
Ollama fonctionne en local. Aucune clé API n’est requise.
Veuillez démarrer votre instance locale pour activer l’IA.
Code (UI)
<div class="ai-warning product">
<strong>Ollama fonctionne en local.</strong><br>
Aucune clé API n’est requise.<br>
Veuillez démarrer votre instance locale pour activer l’IA.
</div>
✅ 3️⃣ VERSION TECHNIQUE (pour développeurs / DeepSite)
Texte
Pour utiliser Ollama, veuillez configurer et démarrer votre instance locale.
Le moteur IA s’exécute hors plateforme et communique via un adaptateur.
Code (UI)
<div class="ai-warning technical">
<strong>Configuration requise :</strong><br>
Pour utiliser Ollama, veuillez configurer et démarrer votre instance locale.<br>
Le moteur IA s’exécute hors plateforme et communique via un adaptateur.
</div>
🎨 CSS COMMUN (pro, propre, DeepSite-compatible)
.ai-warning {
margin: 12px;
padding: 12px;
border-radius: 8px;
font-size: 13px;
line-height: 1.5;
background: #111c2e;
color: #e0e0e0;
border-left: 4px solid #3b82f6;
}
.ai-warning.ui {
border-left-color: #22c55e;
}
.ai-warning.product {
border-left-color: #f59e0b;
}
.ai-warning.technical {
border-left-color: #6366f1;
}
🔌 CODE ADAPTATEUR OLLAMA (accepté par DeepSite)
👉 IMPORTANT :
Ce code NE trompe PAS,
il déclare clairement que l’IA est externe.
async function ollamaStatus() {
try {
const res = await fetch("http://localhost:11434");
return res.ok;
} catch {
return false;
}
}
🧠 UTILISATION DANS ESPACE CODAGE
async function initAI() {
const available = await ollamaStatus();
if (!available) {
console.info("Ollama non actif – instance locale requise");
}
}
- ai-adapter.js +28 -1
- app.js +1 -1
- index.html +9 -1
- style.css +24 -2
|
@@ -1,6 +1,33 @@
|
|
| 1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
async function callAI(prompt) {
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
return {
|
| 5 |
text: `Voici un exemple de réponse en mode démo:\n\n${prompt}\n\nPour utiliser Ollama, veuillez configurer votre instance locale.`,
|
| 6 |
type: 'text'
|
|
|
|
| 1 |
|
| 2 |
+
async function ollamaStatus() {
|
| 3 |
+
try {
|
| 4 |
+
const res = await fetch(`${APP_CONFIG.ollama.baseUrl}/api/tags`);
|
| 5 |
+
return res.ok;
|
| 6 |
+
} catch {
|
| 7 |
+
return false;
|
| 8 |
+
}
|
| 9 |
+
}
|
| 10 |
+
|
| 11 |
async function callAI(prompt) {
|
| 12 |
+
const isOllamaAvailable = await ollamaStatus();
|
| 13 |
+
|
| 14 |
+
if (APP_CONFIG.aiMode === 'demo' || !isOllamaAvailable) {
|
| 15 |
+
return {
|
| 16 |
+
text: `<div class="ai-warning ui">Ollama nécessite une instance locale active pour fonctionner.</div>
|
| 17 |
+
<div class="ai-warning product">
|
| 18 |
+
<strong>Ollama fonctionne en local.</strong><br>
|
| 19 |
+
Aucune clé API n’est requise.<br>
|
| 20 |
+
Veuillez démarrer votre instance locale pour activer l’IA.
|
| 21 |
+
</div>
|
| 22 |
+
<div class="ai-warning technical">
|
| 23 |
+
<strong>Configuration requise :</strong><br>
|
| 24 |
+
Pour utiliser Ollama, veuillez configurer et démarrer votre instance locale.<br>
|
| 25 |
+
Le moteur IA s’exécute hors plateforme et communique via un adaptateur.
|
| 26 |
+
</div>`,
|
| 27 |
+
type: 'html'
|
| 28 |
+
};
|
| 29 |
+
}
|
| 30 |
+
if (APP_CONFIG.aiMode === 'demo') {
|
| 31 |
return {
|
| 32 |
text: `Voici un exemple de réponse en mode démo:\n\n${prompt}\n\nPour utiliser Ollama, veuillez configurer votre instance locale.`,
|
| 33 |
type: 'text'
|
|
@@ -32,7 +32,7 @@ async function sendPrompt() {
|
|
| 32 |
|
| 33 |
// Format the response with proper line breaks
|
| 34 |
if (result.type === 'image') {
|
| 35 |
-
|
| 36 |
<div class="mb-4">
|
| 37 |
<img src="${result.url}" alt="Generated image" class="rounded-lg max-w-full">
|
| 38 |
<p class="text-sm text-gray-400 mt-2">Image générée avec ${result.model}</p>
|
|
|
|
| 32 |
|
| 33 |
// Format the response with proper line breaks
|
| 34 |
if (result.type === 'image') {
|
| 35 |
+
preview.innerHTML = `
|
| 36 |
<div class="mb-4">
|
| 37 |
<img src="${result.url}" alt="Generated image" class="rounded-lg max-w-full">
|
| 38 |
<p class="text-sm text-gray-400 mt-2">Image générée avec ${result.model}</p>
|
|
@@ -149,8 +149,16 @@
|
|
| 149 |
<i data-feather="code" class="w-8 h-8 mx-auto mb-2"></i>
|
| 150 |
<p>Aucun rendu disponible</p>
|
| 151 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 152 |
</div>
|
| 153 |
-
|
| 154 |
</aside>
|
| 155 |
</div>
|
| 156 |
|
|
|
|
| 149 |
<i data-feather="code" class="w-8 h-8 mx-auto mb-2"></i>
|
| 150 |
<p>Aucun rendu disponible</p>
|
| 151 |
</div>
|
| 152 |
+
<div class="ai-warning ui">
|
| 153 |
+
Ollama nécessite une instance locale active pour fonctionner.
|
| 154 |
+
</div>
|
| 155 |
+
<div class="ai-warning product">
|
| 156 |
+
<strong>Ollama fonctionne en local.</strong><br>
|
| 157 |
+
Aucune clé API n’est requise.<br>
|
| 158 |
+
Veuillez démarrer votre instance locale pour activer l'IA.
|
| 159 |
+
</div>
|
| 160 |
</div>
|
| 161 |
+
</div>
|
| 162 |
</aside>
|
| 163 |
</div>
|
| 164 |
|
|
@@ -53,7 +53,29 @@ body {
|
|
| 53 |
#promptInput {
|
| 54 |
color: white;
|
| 55 |
}
|
| 56 |
-
|
| 57 |
.empty {
|
| 58 |
color: #9ca3af;
|
| 59 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 53 |
#promptInput {
|
| 54 |
color: white;
|
| 55 |
}
|
|
|
|
| 56 |
.empty {
|
| 57 |
color: #9ca3af;
|
| 58 |
+
}
|
| 59 |
+
|
| 60 |
+
.ai-warning {
|
| 61 |
+
margin: 12px;
|
| 62 |
+
padding: 12px;
|
| 63 |
+
border-radius: 8px;
|
| 64 |
+
font-size: 13px;
|
| 65 |
+
line-height: 1.5;
|
| 66 |
+
background: #111c2e;
|
| 67 |
+
color: #e0e0e0;
|
| 68 |
+
border-left: 4px solid #3b82f6;
|
| 69 |
+
}
|
| 70 |
+
|
| 71 |
+
.ai-warning.ui {
|
| 72 |
+
border-left-color: #22c55e;
|
| 73 |
+
}
|
| 74 |
+
|
| 75 |
+
.ai-warning.product {
|
| 76 |
+
border-left-color: #f59e0b;
|
| 77 |
+
}
|
| 78 |
+
|
| 79 |
+
.ai-warning.technical {
|
| 80 |
+
border-left-color: #6366f1;
|
| 81 |
+
}
|