I’m trying to create a bot that analyzes the content of a YouTube video link. From this documentation it seemed to me that Gemini 2.0 could do this. But this code returns error 500
async def process_youtube_link(file_uri: str, video_prompt: str) -> str:
try:
video_part = types.Part.from_uri(
file_uri=file_uri,
mime_type="video/mp4",
)
response = client.models.generate_content(
model='gemini-2.0-flash-exp',
contents=[
video_part,
video_prompt,
]
)
if not response or not hasattr(response, "text"):
return "Error"
return response.text.strip()
except Exception as e:
return "Error"
What am I doing wrong?