feat(simulations): getIdees API + hook useIdees (G5)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Hermann_Kitio 2026-04-21 03:09:01 +03:00
parent 555dac17e2
commit 67eb3411c5
2 changed files with 48 additions and 0 deletions

View file

@ -42,3 +42,18 @@ export function correctEo(payload: CorrectEoPayload): Promise<Report> {
timeoutMs: CORRECTION_TIMEOUT_MS,
})
}
const IDEES_TIMEOUT_MS = 15_000
/**
* Récupère 5 suggestions d'idées DeepSeek pour prolonger la rédaction en cours.
* Endpoint : `POST /sujets/idees`. Tâche G5.
* Contraintes backend : sujet_consigne non vide + contenu_partiel 30 mots.
*/
export function getIdees(consigne: string, contenu: string): Promise<string[]> {
return apiFetch<{ idees: string[] }>('/sujets/idees', {
method: 'POST',
body: { sujet_consigne: consigne, contenu_partiel: contenu },
timeoutMs: IDEES_TIMEOUT_MS,
}).then((res) => res.idees)
}