Skip to content

A curated collection of practical AI projects implementing OCR systems, RAG, AI agents, and other AI use cases.

fix(video_understanding_agent): remove unresolved merge conflict markers

Rudy Celekli79e9a2e37e50
diff --git a/multimodal/video_understanding_agent/.env.example b/multimodal/video_understanding_agent/.env.example
index 4a224e2..a037086 100644
--- a/multimodal/video_understanding_agent/.env.example
+++ b/multimodal/video_understanding_agent/.env.example
@@ -1,5 +1,2 @@
-<<<<<<< HEAD
-=======
# Your Gemini API key. Get one for free at https://aistudio.google.com
->>>>>>> 1d1e9f137cfd1123edbae5d8e955ce0b9c7fcf4a
GEMINI_API_KEY=your_key_here
diff --git a/multimodal/video_understanding_agent/app.py b/multimodal/video_understanding_agent/app.py
index 44ccf52..5a79568 100644
--- a/multimodal/video_understanding_agent/app.py
+++ b/multimodal/video_understanding_agent/app.py
@@ -1,11 +1,6 @@
-<<<<<<< HEAD
-import streamlit as st
-import google.generativeai as genai
-=======
"""Streamlit app that accepts a YouTube URL and returns a structured AI-powered summary using the Gemini API."""
import streamlit as st
from google import genai
->>>>>>> 1d1e9f137cfd1123edbae5d8e955ce0b9c7fcf4a
from dotenv import load_dotenv
import os
import re
@@ -30,17 +25,11 @@ YOUTUBE_PATTERN = re.compile(
)
def is_valid_youtube_url(url: str) -> bool:
-<<<<<<< HEAD
- return bool(YOUTUBE_PATTERN.search(url))
-
-def parse_sections(text: str) -> dict:
-=======
"""Returns True if the given string matches a recognized YouTube URL pattern."""
return bool(YOUTUBE_PATTERN.search(url))
def parse_sections(text: str) -> dict:
"""Splits a Gemini response into chapters, takeaways, and action items by matching section headings."""
->>>>>>> 1d1e9f137cfd1123edbae5d8e955ce0b9c7fcf4a
sections = {"chapters": "", "takeaways": "", "actions": ""}
chapter_match = re.search(
@@ -85,13 +74,8 @@ List 4–6 concrete, actionable steps the viewer can take based on the video's c
Be concise, specific, and use the viewer's perspective. Do not include any preamble before the first heading."""
def analyze_video(youtube_url: str) -> dict:
-<<<<<<< HEAD
- genai.configure(api_key=GEMINI_API_KEY)
- model = genai.GenerativeModel("gemini-3-flash-preview")
-=======
"""Sends the YouTube URL to Gemini and returns the parsed structured summary as a dict."""
client = genai.Client(api_key=GEMINI_API_KEY)
->>>>>>> 1d1e9f137cfd1123edbae5d8e955ce0b9c7fcf4a
video_part = {
"file_data": {
@@ -100,14 +84,10 @@ def analyze_video(youtube_url: str) -> dict:
}
}
-<<<<<<< HEAD
- response = model.generate_content([video_part, PROMPT])
-=======
response = client.models.generate_content(
model="gemini-3-flash-preview",
contents=[video_part, PROMPT],
)
->>>>>>> 1d1e9f137cfd1123edbae5d8e955ce0b9c7fcf4a
return parse_sections(response.text)
diff --git a/multimodal/video_understanding_agent/requirements.txt b/multimodal/video_understanding_agent/requirements.txt
index 703d504..1e80dee 100644
--- a/multimodal/video_understanding_agent/requirements.txt
+++ b/multimodal/video_understanding_agent/requirements.txt
@@ -1,7 +1,3 @@
streamlit>=1.35.0
-<<<<<<< HEAD
-google-generativeai>=0.7.0
-=======
google-genai>=1.0.0
->>>>>>> 1d1e9f137cfd1123edbae5d8e955ce0b9c7fcf4a
python-dotenv>=1.0.0