Skip to content

feat: Add Voice-to-Ticket feature with speech recognition pipeline (#207) - #4

Open
kejuunuy wants to merge 47 commits into
gssocfrom
feat/voice-to-ticket-207
Open

feat: Add Voice-to-Ticket feature with speech recognition pipeline (#207)#4
kejuunuy wants to merge 47 commits into
gssocfrom
feat/voice-to-ticket-207

Conversation

@kejuunuy

Copy link
Copy Markdown
Owner

Summary

Implements a complete Voice-to-Ticket feature using OpenAI Whisper for hands-free support request submission.

Backend Changes

Enhanced backend/services/voice_service.py:

  • Async Whisper transcription with lazy model loading (double-checked lock)
  • Audio validation: format checking (webm, wav, mp3, ogg, m4a, flac), size limits (25MB)
  • Language hint support for better accuracy
  • Guaranteed temp file cleanup in finally block
  • Structured error responses with logging

New backend/routes/voice.py (FastAPI router):

  • POST /api/voice/transcribe — Upload audio → get transcribed text, language, confidence, duration
  • POST /api/voice/create-ticket — Full voice-to-ticket pipeline with title suggestion
  • GET /api/voice/health — Service availability check

Updated backend/main.py:

  • Registered voice router via app.include_router(voice_router)
  • Removed redundant inline endpoint

New backend/tests/test_voice_service.py:

  • 19 tests covering validation, suffix detection, title extraction, transcription pipeline (mocked), and API endpoints

Frontend Changes

Rewrote Frontend/src/components/shared/VoiceRecorder.jsx:

  • Real-time audio level visualizer (12-bar frequency display)
  • Recording duration timer with configurable max duration
  • Language hint badge display
  • Best-supported MIME type selection (audio/webm;codecs=opus preferred)
  • Transcript preview with checkmark confirmation
  • Graceful error handling: permission denied, no microphone, server errors
  • Accessible: keyboard navigable, ARIA labels, screen-reader support
  • Clean unmount with full resource cleanup

API Endpoints

Endpoint Method Description
/api/voice/transcribe POST Upload audio file → transcription result
/api/voice/create-ticket POST Upload audio → transcribe → suggested ticket
/api/voice/health GET Check Whisper model availability

Fixes riteshbonthalakoti#207

Wallet: 0x96e04aC80b9b18ddbfB7e921800feF673BC1CA26

basantnema31 and others added 30 commits May 27, 2026 21:39
…riteshbonthalakoti#175 (riteshbonthalakoti#296)

* feat: Add Slack & Teams webhook integration riteshbonthalakoti#175

* feat: add Slack/Teams webhook integration and fix infinite spinner bug riteshbonthalakoti#175

* feat: add webhook service backend and Supabase migration riteshbonthalakoti#175

* feat: add webhook service, WebhookSettings component and Supabase migration riteshbonthalakoti#175

* fix webhook settings component
…shbonthalakoti#264)

* fix: remove hardcoded Supabase service_role JWT and personal emails from source

CRITICAL security fix - removes hardcoded Supabase service_role JWT
from Git-tracked migration files. The JWT provided full admin database
access (bypassing all RLS) and was exposed to every repo clone.

Changes:
- Remove hardcoded service_role JWT from migration files
- Hardened webhook trigger to fail gracefully if vault is unconfigured
- Added vault setup script (supabase/scripts/setup_vault.py) that reads
  SUPABASE_SERVICE_KEY from environment at deploy time
- Added supabase/.temp/ to .gitignore
- Replaced hardcoded personal emails in edge functions with env vars

Closes riteshbonthalakoti#249

* fix(security): remove hardcoded personal email, Supabase project ref, and tracked .temp files from source

* fix(security): replace hardcoded HF username with GitHub secret
…eshbonthalakoti#263)

* fix: remove hardcoded Supabase service_role JWT and personal emails from source

CRITICAL security fix - removes hardcoded Supabase service_role JWT
from Git-tracked migration files. The JWT provided full admin database
access (bypassing all RLS) and was exposed to every repo clone.

Changes:
- Remove hardcoded service_role JWT from migration files
- Hardened webhook trigger to fail gracefully if vault is unconfigured
- Added vault setup script (supabase/scripts/setup_vault.py) that reads
  SUPABASE_SERVICE_KEY from environment at deploy time
- Added supabase/.temp/ to .gitignore
- Replaced hardcoded personal emails in edge functions with env vars

Closes riteshbonthalakoti#249

* fix(security): remove hardcoded personal email, Supabase project ref, and tracked .temp files from source

* fix(security): replace hardcoded mock passwords with placeholder
…iteshbonthalakoti#262)

* fix: remove hardcoded Supabase service_role JWT and personal emails from source

CRITICAL security fix - removes hardcoded Supabase service_role JWT
from Git-tracked migration files. The JWT provided full admin database
access (bypassing all RLS) and was exposed to every repo clone.

Changes:
- Remove hardcoded service_role JWT from migration files
- Hardened webhook trigger to fail gracefully if vault is unconfigured
- Added vault setup script (supabase/scripts/setup_vault.py) that reads
  SUPABASE_SERVICE_KEY from environment at deploy time
- Added supabase/.temp/ to .gitignore
- Replaced hardcoded personal emails in edge functions with env vars

Closes riteshbonthalakoti#249

* fix(security): remove hardcoded personal email, Supabase project ref, and tracked .temp files from source

* fix(security): remove hardcoded admin credentials from adminStore.js
…HuggingFace - Fixes riteshbonthalakoti#206 (riteshbonthalakoti#339)

* feat(i18n): Add multi-language auto-translation pipeline with HuggingFace - Fixes riteshbonthalakoti#206

* fix(lint): remove unused getTranslationInfo variable in MyTickets.jsx
…) (riteshbonthalakoti#496)

* fix(tests): resolve type mismatch in FakeTable.execute filters causing integration test failures

* feat(digest): Add AI-Generated Weekly Digest Email Report with Resend and Admin Settings UI

* feat(voice): implement asynchronous voice-to-ticket transcription pipeline

* fix(backend): use dynamic import for whisper to fix CI smoke test

* feat(nlp): implement async translation pipeline with bounded LRU cache
… (riteshbonthalakoti#489)

* fix(tests): resolve type mismatch in FakeTable.execute filters causing integration test failures

* feat(digest): Add AI-Generated Weekly Digest Email Report with Resend and Admin Settings UI

* feat(voice): implement asynchronous voice-to-ticket transcription pipeline

* fix(backend): use dynamic import for whisper to fix CI smoke test
…onthalakoti#471)

Closes riteshbonthalakoti#362 - company_size reverted to default '50-200' on page refresh.
Now saves selection to localStorage and restores on mount.

Co-authored-by: root <root@localhost.localdomain>
…halakoti#470)

Closes riteshbonthalakoti#364 - predictTicket was silently returning mock data on errors,
masking backend failures. Now throws the error so UI can handle it.

Co-authored-by: root <root@localhost.localdomain>
…eshbonthalakoti#469)

Closes riteshbonthalakoti#381 - client heartbeat was sending 'pong' which the server treats as no-op.
Changed to 'ping' so the server can properly track client liveness.

Co-authored-by: root <root@localhost.localdomain>
tmdeveloper007 and others added 17 commits May 29, 2026 00:02
…shbonthalakoti#459)

Closes riteshbonthalakoti#387 - added 10MB limit on base64 images in both TicketRequest
model and GeminiService.analyze_image() as defense-in-depth.

Co-authored-by: root <root@localhost.localdomain>
Closes riteshbonthalakoti#388 - logout only cleared cookies but left Supabase session valid.
Now calls client.auth.sign_out(token) to invalidate the session server-side.

Co-authored-by: root <root@localhost.localdomain>
…nthalakoti#389) (riteshbonthalakoti#457)

* fix: add authentication to PATCH /tickets/{ticket_id} endpoint

Closes riteshbonthalakoti#389 - the endpoint had no auth check, allowing anyone to modify tickets.
Added Depends(get_current_user) to require valid session.

* temp: remove workflow file for push

---------

Co-authored-by: root <root@localhost.localdomain>
…Settings UI (riteshbonthalakoti#437)

* fix(tests): resolve type mismatch in FakeTable.execute filters causing integration test failures

* feat(digest): Add AI-Generated Weekly Digest Email Report with Resend and Admin Settings UI
…es (Resolves riteshbonthalakoti#205) (riteshbonthalakoti#434)

* feat(sla): Add SLA breach predictor with estimate endpoint and UI badges - Fixes riteshbonthalakoti#205

* feat(sla): Add cached SLA breach predictor with detailed estimator card and full coverage

* fix(frontend): restore useMemo header in AdminTickets.jsx to resolve syntax compile error

---------

Co-authored-by: Sarthak Godse <sarthakgodse03@gmail.com>
…#381) (riteshbonthalakoti#391)

Co-authored-by: curioufly <curioufly@users.noreply.github.com>
…nthalakoti#342)

* docs: add local backend setup and schema verification guide

* docs:removed placeholder contribution section
…iteshbonthalakoti#207)

Implements a complete voice-to-ticket workflow using OpenAI Whisper:

Backend:
- Enhanced voice_service.py with async Whisper transcription, audio validation
  (format, size), multi-format support (webm, wav, mp3, ogg, m4a, flac),
  language hinting, and guaranteed temp file cleanup
- New backend/routes/voice.py with dedicated FastAPI router:
  POST /api/voice/transcribe — upload audio → get transcribed text
  POST /api/voice/create-ticket — full voice-to-ticket pipeline
  GET  /api/voice/health — service availability check
- Registered voice router in main.py, removed inline endpoint
- Added comprehensive test suite (test_voice_service.py)

Frontend:
- Rewrote VoiceRecorder.jsx with enhanced UX: real-time audio visualizer,
  recording duration display, language hint support, graceful error handling,
  transcript preview, and full accessibility support

Fixes riteshbonthalakoti#207
Wallet: 0x96e04aC80b9b18ddbfB7e921800feF673BC1CA26
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.