| 1234567891011121314151617181920212223 |
- from fastapi import APIRouter, Depends
- from .deps import get_speech_service, get_understand_image_service
- from ..schemas.base import DataResponse, TextToSpeechRequest, UnderstandImageRequest
- from ..services.speech_service import SpeechService
- from ..services.vl_service import VLService
- router = APIRouter()
- @router.get("/ping", tags=["default"])
- def ping():
- return {"message": "pong"}
- @router.post('/llm/text-to-speech', response_model=DataResponse, tags=["llm"])
- def text_to_speech(req: TextToSpeechRequest, service: SpeechService = Depends(get_speech_service)):
- return service.text_to_speech(req)
- @router.post('/llm/understand-image', response_model=DataResponse, tags=["understand-image"])
- def understand_image(req: UnderstandImageRequest, service: VLService = Depends(get_understand_image_service)):
- return service.understand_image(req)
|