Update main.py
Browse files
main.py
CHANGED
@@ -1,3 +1,6 @@
|
|
|
|
|
|
|
|
1 |
from fastapi import FastAPI, HTTPException
|
2 |
from fastapi.middleware.cors import CORSMiddleware
|
3 |
import google.generativeai as genai
|
@@ -7,8 +10,7 @@ from bs4 import BeautifulSoup
|
|
7 |
import validators
|
8 |
from youtube_transcript_api import YouTubeTranscriptApi
|
9 |
|
10 |
-
|
11 |
-
load_dotenv()
|
12 |
genai.configure(api_key=os.getenv("GOOGLE_API_KEY"))
|
13 |
|
14 |
app = FastAPI()
|
@@ -275,6 +277,7 @@ async def ytranscript(url : str):
|
|
275 |
transcript_text=extract_transcript(url)
|
276 |
print(transcript_text)
|
277 |
if transcript_text:
|
|
|
278 |
response=model.generate_content([prompt6,transcript_text])
|
279 |
print(response.text)
|
280 |
return response.text
|
|
|
1 |
+
from dotenv import load_dotenv
|
2 |
+
load_dotenv()
|
3 |
+
|
4 |
from fastapi import FastAPI, HTTPException
|
5 |
from fastapi.middleware.cors import CORSMiddleware
|
6 |
import google.generativeai as genai
|
|
|
10 |
import validators
|
11 |
from youtube_transcript_api import YouTubeTranscriptApi
|
12 |
|
13 |
+
|
|
|
14 |
genai.configure(api_key=os.getenv("GOOGLE_API_KEY"))
|
15 |
|
16 |
app = FastAPI()
|
|
|
277 |
transcript_text=extract_transcript(url)
|
278 |
print(transcript_text)
|
279 |
if transcript_text:
|
280 |
+
print("hi")
|
281 |
response=model.generate_content([prompt6,transcript_text])
|
282 |
print(response.text)
|
283 |
return response.text
|