from typing import Union | |
from fastapi import FastAPI | |
from src.utils_youtube import get_youtube_transcript | |
## create a new FASTAPI app instance | |
app=FastAPI() | |
def home(): | |
return {"message":"Hello World"} | |
# Define a function to handle the GET request at `/generate` | |
def generate(youtubeurl,src_lang,target_lang): | |
transript=get_youtube_transcript(youtubeurl,src_lang,target_lang) | |
return {"output":f"{transript}"} | |