File size: 572 Bytes
6b4cdc0
 
8c5fdf0
6b4cdc0
 
 
 
 
 
 
 
 
 
 
 
 
 
248fea5
6b4cdc0
 
 
 
 
8c5fdf0
15fd379
8c5fdf0
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
from fastapi import FastAPI, UploadFile
from pydantic import BaseModel
from .functions import handle_url, get_health, test_response


class VideoURL(BaseModel):
    url: str
    from_lang: str = "en"
    to_lang: str = "hi"
    gender: str = "MALE"


app = FastAPI()


@app.get("/")
async def main():
    return get_health()

  
@app.post("/synthesize_video_url")
async def synthesize_video_url(video: VideoURL):
    return handle_url(video.url, video.from_lang, video.to_lang, video.gender)

@app.post("/test")
async def test(video: VideoURL):
    return test_response()