feat: intégration du moteur d'IA (ai.py) et génération de la première réponse
Build and Push Docker Image / build-and-push (push) Successful in 42s

This commit is contained in:
xavier committed 2026-10-07 11:00:49 +02:00
1 parent 00a92de1c4
commit 9288e849af
4 files changed
+98 -10

No files matched your search

+11 -8
View File
@@ -264,22 +264,25 @@
nextTick(() => lucide.createIcons());
try {
await fetch(`/api/projects/${activeProject.value.id}/messages`, {
const response = await fetch(`/api/projects/${activeProject.value.id}/messages`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ role: 'user', content: userText })
});
// SIMULATION TEMPORAIRE : Attente de l'IA (2 secondes)
setTimeout(() => {
isAiThinking.value = false;
scrollToBottom();
// La prochaine étape remplacera ce setTimeout par le véritable appel au moteur IA !
}, 2000);
if (response.ok) {
// L'API nous renvoie l'historique à jour avec la réponse de l'IA
messages.value = await response.json();
} else {
const err = await response.json();
alert("Erreur: " + err.detail);
}
} catch (error) {
console.error("Erreur envoi message", error);
} finally {
isAiThinking.value = false;
scrollToBottom();
nextTick(() => lucide.createIcons());
}
};