Contrat unique `profondeur` ('rapide' | 'approfondi', défaut rapide) dans
utils/chatProfondeur.ts (libellés partagés). Les 3 routes Bifrost lisent
body.profondeur ?? body.mode, choisissent le tier (20b / 120b + replis), un
prompt système « réflexion » (Entraide, Réseaux, Taff) au même format JSON, et un
budget max_tokens adapté. Pensées lit body.profondeur (jamais body.mode, réservé à
LightRAG) : posture réflexion ajoutée au user_prompt + max_total_tokens 40000.
Modèle servi journalisé, et champ debug exposé uniquement en dev.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015vcVGz8i4WpZm2dixKUiSD
28 lines
1.1 KiB
TypeScript
28 lines
1.1 KiB
TypeScript
/**
|
|
* 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'
|
|
}
|