Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -102,6 +102,7 @@ with tab1:
|
|
102 |
# Tab 2: YouTube Video Analyzer with Groq
|
103 |
with tab2:
|
104 |
st.title("YouTube Video Analyzer")
|
|
|
105 |
|
106 |
# Initialize the agent for YouTube analysis
|
107 |
try:
|
@@ -117,14 +118,18 @@ with tab2:
|
|
117 |
st.stop()
|
118 |
|
119 |
video_url = st.text_input("Enter YouTube Video URL:", "")
|
120 |
-
user_query = st.text_area(
|
|
|
|
|
|
|
|
|
121 |
|
122 |
-
if st.button("Analyze"):
|
123 |
if video_url:
|
124 |
with st.spinner("Analyzing..."):
|
125 |
try:
|
126 |
if user_query:
|
127 |
-
prompt = f"""Analyze the
|
128 |
|
129 |
Respond to the following query using video insights and supplementary web research:
|
130 |
|
@@ -134,10 +139,7 @@ with tab2:
|
|
134 |
|
135 |
Video URL: {video_url}"""
|
136 |
else:
|
137 |
-
|
138 |
-
|
139 |
-
Video URL: {video_url}"""
|
140 |
-
|
141 |
output = youtube_agent.run(prompt)
|
142 |
|
143 |
st.markdown(output.content)
|
|
|
102 |
# Tab 2: YouTube Video Analyzer with Groq
|
103 |
with tab2:
|
104 |
st.title("YouTube Video Analyzer")
|
105 |
+
st.header("Analyze Youtube video using video link 🎬 🧷")
|
106 |
|
107 |
# Initialize the agent for YouTube analysis
|
108 |
try:
|
|
|
118 |
st.stop()
|
119 |
|
120 |
video_url = st.text_input("Enter YouTube Video URL:", "")
|
121 |
+
user_query = st.text_area(
|
122 |
+
"What insights are you seeking from the video?",
|
123 |
+
placeholder="Ask anything about the video content. The AI agent will analyze and gather additional context if needed. This AI agent can search the internet.",
|
124 |
+
help="Provide specific questions or insights you want from the video."
|
125 |
+
)
|
126 |
|
127 |
+
if st.button(""🔍 Analyze Video", key="analyze_video_button""):
|
128 |
if video_url:
|
129 |
with st.spinner("Analyzing..."):
|
130 |
try:
|
131 |
if user_query:
|
132 |
+
prompt = f"""Analyze the video captions for content and context. Provide a detailed summary. Search the internet for similar topics discussed in the uploaded video.
|
133 |
|
134 |
Respond to the following query using video insights and supplementary web research:
|
135 |
|
|
|
139 |
|
140 |
Video URL: {video_url}"""
|
141 |
else:
|
142 |
+
st.warning("Please enter a question or insight to analyze the video.")
|
|
|
|
|
|
|
143 |
output = youtube_agent.run(prompt)
|
144 |
|
145 |
st.markdown(output.content)
|