Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -118,29 +118,21 @@ with tab2:
|
|
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
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
{user_query}
|
138 |
-
|
139 |
-
Provide a detailed, user-friendly, and actionable response.
|
140 |
-
|
141 |
-
Video URL: {video_url}"""
|
142 |
else:
|
143 |
-
|
|
|
144 |
output = youtube_agent.run(prompt)
|
145 |
|
146 |
st.markdown(output.content)
|
|
|
118 |
st.stop()
|
119 |
|
120 |
video_url = st.text_input("Enter YouTube Video URL:", "")
|
121 |
+
user_query = st.text_area("Enter your question about the video (optional):", "")
|
|
|
|
|
|
|
|
|
122 |
|
123 |
if st.button("π Analyze Video", key="analyze_video_button"):
|
124 |
if video_url:
|
125 |
with st.spinner("Analyzing..."):
|
126 |
try:
|
127 |
if user_query:
|
128 |
+
prompt = f"""Analyze the video for content and context. Provide a detailed summary. Search the internet for similar topics discussed in the uploaded video.
|
129 |
+
Respond to the following query using video insights and supplementary web research:
|
130 |
+
{user_query}
|
131 |
+
Provide a detailed, user-friendly, and actionable response.
|
132 |
+
Video URL: {video_url}""" # Added Video URL for context
|
|
|
|
|
|
|
|
|
|
|
133 |
else:
|
134 |
+
prompt = f"""Analyze the uploaded video for content and context. Provide a detailed summary. Search the internet for similar topics discussed in the uploaded video.
|
135 |
+
Video URL: {video_url}""" # Added Video URL for context
|
136 |
output = youtube_agent.run(prompt)
|
137 |
|
138 |
st.markdown(output.content)
|