Skip to content

Changed Prompt and added feedback voice#10

Merged
Butenkite merged 1 commit into
mainfrom
response-feedback-tts
Jun 6, 2026
Merged

Changed Prompt and added feedback voice#10
Butenkite merged 1 commit into
mainfrom
response-feedback-tts

Conversation

@Butenkite

@Butenkite Butenkite commented Jun 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

After LLM feedback is generated for a per-question scorecard or an end-of-interview session review, the selected interviewer voice reads that feedback aloud via the existing `/speech/tts` endpoint. Long feedback scripts are split into Groq Orpheus\u2019s 200-character chunks and played sequentially. The LLM system prompts for `/feedback/generate` and `/feedback/generate-session` now require second-person, in-the-moment coaching language instead of third-person candidate evaluation phrasing.

Feedback and speech flow

Flow Trigger Spoken content UI behavior
Per-question feedback (new) `ScorecardPanel` `onFeedbackReady` after `POST /feedback/generate` Script from `buildQualitativeFeedbackScript` (summary, strengths, improvements, delivery notes) Auto-opens scorecard when stage is `done`; disables Next Question while audio plays; status shows interviewer sharing feedback
End-of-interview feedback (new) `SessionScorecardPanel` `onFeedbackReady` after `POST /feedback/generate-session` Script from `buildSessionFeedbackScript` (overall summary, strengths, improvements, delivery notes) Speaks once per finished session; status updated during playback
TTS chunking (new) Any `speakWithGroq` call with text over 200 characters Sentence/word-boundary chunks sent to `POST /speech/tts` one at a time Prevents TTS 502 failures on long feedback text
LLM voice/tone (modified) `/feedback/generate` and `/feedback/generate-session` Shared `_VOICE_INSTRUCTIONS` block in system prompts Feedback fields address the user directly with conversational coaching language

File-by-file changes

Backend / API

  • `backend/services/llm/router.py`: Adds shared `_VOICE_INSTRUCTIONS` and rewrites per-answer and session system prompts to require direct second-person coaching tone so generated feedback reads naturally when spoken aloud.

Frontend components

  • `frontend/app/InterviewClient.tsx`: Wires feedback TTS after scorecard fetch, auto-shows per-question feedback on `done`, tracks speaking state, aborts playback on dismiss/next question, and imports shared TTS/speech-script helpers instead of an inline TTS implementation.
  • `frontend/app/scorecard/ScorecardPanel.tsx`: Adds optional `onFeedbackReady` callback invoked when fetched or pre-resolved feedback is ready so the interview client can trigger spoken playback.
  • `frontend/app/scorecard/SessionScorecardPanel.tsx`: Adds optional `onFeedbackReady` callback invoked when session feedback fetch completes so end-of-interview spoken feedback can start.

Shared / utilities

  • `frontend/lib/interview-coach/feedbackSpeech.ts`: New helpers that assemble per-question and session LLM feedback JSON into a single spoken script for TTS without generating new content.
  • `frontend/lib/speech/tts.ts`: New shared `speakWithGroq` with 200-character chunk splitting, sequential playback, and abort support, replacing the prior inline implementation in `InterviewClient.tsx`.

@Butenkite Butenkite self-assigned this Jun 6, 2026
@Butenkite
Butenkite merged commit 57f004f into main Jun 6, 2026
2 checks passed
@Butenkite
Butenkite deleted the response-feedback-tts branch June 6, 2026 22:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant