Spaces:
Sleeping
Sleeping
Update app.py
Browse files16 unmodified lines171819202021222324252526272829303132313233343536373738394041424243444521 unmodified lines67686970707172737473747576777879808182837677787980818283848585868788898990919219 unmodified lines11211311411516 unmodified lines
# Page configurationst.set_page_config( page_title="Multimodal AI Agent- Video Summarizer", page_title="Multimodal AI Agent Video Notes Writer", page_icon="π₯", layout="wide")
st.title("Phidata Video AI Summarizer Agent π₯π€π¬")st.title("Phidata Video AI Notes Writer π₯π€π¬")st.header("Powered by Gemini 2.0 Flash Exp")
@st.cache_resourcedef initialize_agent(): return Agent( name="Video AI Summarizer", model=Gemini(id="gemini-2.0-flash-exp"), name="Video AI Notes-Writer", model=Gemini(id="Gemini-2.0-flash-exp"), tools=[DuckDuckGo()], markdown=True, )
## Initialize the agent# Initialize the agentmultimodal_Agent = initialize_agent()
# File uploadervideo_file = st.file_uploader( "Upload a video file", type=['mp4', 'mov', 'avi'], help="Upload a video for AI analysis" "Upload a video file", type=['mp4'], help="Upload a video for AI analysis")
if video_file:21 unmodified lines time.sleep(1) processed_video = get_file(processed_video.name) # Enhanced prompt for detailed paragraph-style student notes # Enhanced prompt for detailed student-style notes with improved structure analysis_prompt = ( f""" Analyze the uploaded video thoroughly and create EXTREMELY DETAILED STUDENT NOTES in full paragraph format. Analyze the uploaded video thoroughly and generate EXTREMELY DETAILED STUDENT NOTES in full paragraph format.
Your notes should: - Begin with a thorough introduction to the topic - Use full, detailed paragraphs (NOT bullet points) to explain concepts - Structure the content with clear headings and subheadings - Include detailed explanations and elaborations on key concepts - Connect ideas using transition sentences between paragraphs - Use complete sentences and proper grammar throughout - Create a cohesive narrative flow like detailed textbook content - Include a conclusion paragraph summarizing the main points - Begin with a comprehensive introduction that outlines the topic and objectives. - Divide the content into clearly labeled sections with headings and subheadings (e.g., "Introduction", "Main Concepts", "Detailed Explanations", and "Conclusion"). - Provide detailed explanations of key concepts, ensuring each section includes a narrative summary of its key takeaways. - Include smooth transitions between sections and paragraphs for a cohesive flow. - Reference and explain any visual aids, diagrams, or slides mentioned in the lecture. - Incorporate reflective questions or critical insights to prompt further analysis of the material. - Maintain a student-friendly yet rigorous tone, similar to well-structured textbook content. - Conclude with a summary paragraph that encapsulates the main ideas. IMPORTANT: Do NOT use bullet points or lists. Present all information in well-developed paragraphs. IMPORTANT: DO NOT use bullet points or lists. Present all information in well-developed paragraphs. Additional context/question from user: {user_query} The notes should read like detailed textbook content that thoroughly explains all concepts from the video. The final output should resemble detailed, structured textbook content that thoroughly explains all concepts from the video. """ ) 19 unmodified lines Path(video_path).unlink(missing_ok=True)else: st.info("Upload a video file to begin analysis.") app.py+19-20