feat(s2s-text): dedicated text-mode prompt + Markdown rendering
Architecture fix: voice and text mode now have completely separate prompts. Backend: - VoiceAssistantProfileSupport.buildTextSystemRole: dedicated text-mode system role that inherits all business rules (identity, KB-first, sensitive topics, sales guidance, personal info) but removes voice-specific constraints (short sentences, colloquial, single-line conclusion). - DEFAULT_TEXT_SPEAKING_STYLE: text-specific style demanding detailed, structured, Markdown-formatted answers with complete information. - VoiceGatewayService.handleStart: switch between voice/text system role and speaking style based on state.textMode. - VoiceGatewayService.buildStartSessionPayload: preserve Markdown in text mode (voice mode still strips asterisks/backticks via normalizeTextForSpeech to avoid TTS pronouncing format chars). Frontend: - Added react-markdown@9 + remark-gfm@4 dependencies. - ChatPanel renders assistant messages (non-voice) with ReactMarkdown: headings, lists (ul/ol), bold, italic, inline/block code, tables, blockquote, links, horizontal rules — all styled with Tailwind classes matching the dark theme. - User messages and voice-handoff messages remain plain text. Verification: mvn test VoiceGatewaySmokeTest 20/20 pass, vite build succeeds.
This commit is contained in:
@@ -13,7 +13,9 @@
|
||||
"axios": "^1.6.2",
|
||||
"lucide-react": "^0.344.0",
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0"
|
||||
"react-dom": "^18.2.0",
|
||||
"react-markdown": "^9.1.0",
|
||||
"remark-gfm": "^4.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tailwindcss/vite": "^4.0.0",
|
||||
|
||||
Reference in New Issue
Block a user