1234567891011121314151617 |
- from fastapi import APIRouter, Depends
- from .deps import get_speech_service
- from ..schemas.llm import TextToSpeechResponse, TextToSpeechRequest
- from ..services.speech_service import SpeechService
- router = APIRouter()
- @router.get("/ping", tags=["default"])
- def ping():
- return {"message": "pong"}
- @router.post('/llm/text-to-speech', response_model=TextToSpeechResponse, tags=["llm"])
- def text_to_speech(req: TextToSpeechRequest, service: SpeechService = Depends(get_speech_service)):
- return service.text_to_speech(req)
|