devin-ai commited on
Commit
55b1750
·
verified ·
1 Parent(s): ffaaa8b

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +6 -9
main.py CHANGED
@@ -273,19 +273,16 @@ async def webchat(question:str):
273
  @app.get("/youtube")
274
  async def ytranscript(url : str):
275
  global transcript
276
- try:
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
284
-
285
- else:
286
- return {"unable to retrieve data"}
287
- except:
288
- raise HTTPException(status_code=500, detail="Internal Server Error")
289
 
290
 
291
  @app.post("/ytqanda")
 
273
  @app.get("/youtube")
274
  async def ytranscript(url : str):
275
  global transcript
276
+ transcript_text=extract_transcript(url)
277
+ print(transcript_text)
278
+ if transcript_text:
279
+ try:
280
  print("hi")
281
  response=model.generate_content([prompt6,transcript_text])
282
  print(response.text)
283
  return response.text
284
+ except:
285
+ raise HTTPException(status_code=500, detail="Internal Server Error")
 
 
 
286
 
287
 
288
  @app.post("/ytqanda")