routes.py 534 B

1234567891011121314151617
  1. from fastapi import APIRouter, Depends
  2. from .deps import get_speech_service
  3. from ..schemas.speech import TextToSpeechResponse, TextToSpeechRequest
  4. from ..services.speech_service import SpeechService
  5. router = APIRouter()
  6. @router.get("/ping", tags=["default"])
  7. def ping():
  8. return {"message": "pong"}
  9. @router.post('/llm/text-to-speech', response_model=TextToSpeechResponse, tags=["llm"])
  10. def text_to_speech(req: TextToSpeechRequest, service: SpeechService = Depends(get_speech_service)):
  11. return service.text_to_speech(req)