Improve deployment safety and chat reliability
Deploy FluentGerman.ai / deploy (push) Successful in 1m25s
Deploy FluentGerman.ai / deploy (push) Successful in 1m25s
This commit is contained in:
@@ -7,7 +7,7 @@ from fastapi.responses import Response
|
||||
from app.auth import require_admin, get_current_user
|
||||
from app.config import get_settings
|
||||
from app.models import User
|
||||
from app.schemas import VoiceConfigOut, VoiceInstructionRequest
|
||||
from app.schemas import SynthesizeRequest, VoiceConfigOut, VoiceInstructionRequest
|
||||
from app.services.llm_service import summarize_instruction
|
||||
from app.services.voice_service import synthesize, transcribe
|
||||
|
||||
@@ -48,12 +48,12 @@ async def transcribe_audio(
|
||||
|
||||
@router.post("/synthesize")
|
||||
async def synthesize_text(
|
||||
text: str,
|
||||
body: SynthesizeRequest,
|
||||
user: User = Depends(get_current_user),
|
||||
):
|
||||
"""Convert text to speech audio (API mode only)."""
|
||||
try:
|
||||
audio_bytes = await synthesize(text)
|
||||
audio_bytes = await synthesize(body.text)
|
||||
return Response(content=audio_bytes, media_type="audio/mpeg")
|
||||
except Exception as e:
|
||||
logger.error(f"Synthesis failed: {str(e)}", exc_info=True)
|
||||
|
||||
Reference in New Issue
Block a user