from fastapi import APIRouter, Depends from .deps import get_speech_service, get_understand_image_service, get_copywriting_evaluation_service from ..schemas.base import DataResponse, TextToSpeechRequest, UnderstandImageRequest, CopywritingEvaluationRequest from ..services.speech_service import SpeechService from ..services.vl_service import VLService from ..services.evaluation_service import EvaluationService 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=["llm"]) def understand_image(req: UnderstandImageRequest, service: VLService = Depends(get_understand_image_service)): return service.understand_image(req) @router.post('/llm/copywriting-evaluation', response_model=DataResponse, tags=["llm"]) def copywriting_evaluation(req: CopywritingEvaluationRequest, service: EvaluationService = Depends(get_copywriting_evaluation_service)): return service.copywriting_evaluation(req)