merge: feat/aep-b1-chatbot — checkpoint AEP (intégration du 22/10)
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
* Mode de profondeur des chatbots (M3) — contrat partagé front/serveur.
|
||||
* Champ de body : `profondeur` = 'rapide' | 'approfondi' (défaut 'rapide').
|
||||
* Les libellés affichés vivent ICI, à un seul endroit : les changer ne touche ni
|
||||
* le composant ni le serveur.
|
||||
*/
|
||||
export type ChatProfondeur = 'rapide' | 'approfondi'
|
||||
|
||||
export const CHAT_PROFONDEUR_DEFAUT: ChatProfondeur = 'rapide'
|
||||
|
||||
export const CHAT_PROFONDEUR_LIBELLES: Record<ChatProfondeur, string> = {
|
||||
rapide: 'Question',
|
||||
approfondi: 'Réflexion plus profonde',
|
||||
}
|
||||
|
||||
/** Sous-texte (title/aria) de chaque option. */
|
||||
export const CHAT_PROFONDEUR_AIDES: Record<ChatProfondeur, string> = {
|
||||
rapide: 'Réponse directe et concise',
|
||||
approfondi: 'Une réponse plus longue, qui questionne ton besoin avant de répondre',
|
||||
}
|
||||
|
||||
export const CHAT_PROFONDEURS = Object.keys(CHAT_PROFONDEUR_LIBELLES) as ChatProfondeur[]
|
||||
|
||||
/** Normalise une valeur inconnue (body, stockage) vers un mode valide. */
|
||||
export function normaliserProfondeur(v: unknown): ChatProfondeur {
|
||||
return v === 'approfondi' ? 'approfondi' : 'rapide'
|
||||
}
|
||||
Reference in New Issue
Block a user