mirror of
https://github.com/mblanke/StrikePackageGPT.git
synced 2026-03-01 14:20:21 -05:00
Address code review feedback: improve security, error handling, and documentation
Co-authored-by: mblanke <9078342+mblanke@users.noreply.github.com>
This commit is contained in:
@@ -1057,14 +1057,14 @@ async def get_nmap_hosts(scan_id: Optional[str] = None):
|
||||
# ============== Voice Control Endpoints ==============
|
||||
|
||||
@app.post("/api/voice/transcribe")
|
||||
async def transcribe_audio(audio: bytes = None):
|
||||
async def transcribe_audio(audio_data: Optional[bytes] = None):
|
||||
"""Transcribe audio to text using Whisper"""
|
||||
if not audio:
|
||||
if not audio_data:
|
||||
raise HTTPException(status_code=400, detail="No audio data provided")
|
||||
|
||||
try:
|
||||
from . import voice
|
||||
result = voice.transcribe_audio(audio)
|
||||
result = voice.transcribe_audio(audio_data)
|
||||
return result
|
||||
except Exception as e:
|
||||
raise HTTPException(status_code=500, detail=f"Transcription error: {str(e)}")
|
||||
|
||||
Reference in New Issue
Block a user