Spaces:
Sleeping
Sleeping
Update app.py
Browse files16 unmodified lines171819202122232425262728293031323334353637383940414243444521 unmodified lines676869707172737475767778798081828384858687888990919219 unmodified lines11211311411516 unmodified lines# Page configurationst.set_page_config(page_title="Multimodal AI Agent- Video Summarizer",page_icon="π₯",layout="wide")st.title("Phidata Video AI Summarizer Agent π₯π€π¬")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"),tools=[DuckDuckGo()],markdown=True,)## 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")if video_file:21 unmodified linestime.sleep(1)processed_video = get_file(processed_video.name)# Enhanced prompt for detailed paragraph-style student notesanalysis_prompt = (f"""Analyze the uploaded video thoroughly and create 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 pointsIMPORTANT: 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.""")19 unmodified linesPath(video_path).unlink(missing_ok=True)else:st.info("Upload a video file to begin analysis.")16 unmodified lines171819202122232425262728293031323334353637383940414243444521 unmodified lines676869707172737475767778798081828384858687888990919219 unmodified lines11211311416 unmodified lines# Page configurationst.set_page_config(page_title="Multimodal AI Agent Video Notes Writer",page_icon="π₯",layout="wide")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 Notes-Writer",model=Gemini(id="Gemini-2.0-flash-exp"),tools=[DuckDuckGo()],markdown=True,)# Initialize the agentmultimodal_Agent = initialize_agent()# File uploadervideo_file = st.file_uploader("Upload a video file", type=['mp4'], help="Upload a video for AI analysis")if video_file:21 unmodified linestime.sleep(1)processed_video = get_file(processed_video.name)# Enhanced prompt for detailed student-style notes with improved structureanalysis_prompt = (f"""Analyze the uploaded video thoroughly and generate EXTREMELY DETAILED STUDENT NOTES in full paragraph format.Your notes should:- 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.Additional context/question from user: {user_query}The final output should resemble detailed, structured textbook content that thoroughly explains all concepts from the video.""")19 unmodified linesPath(video_path).unlink(missing_ok=True)else:st.info("Upload a video file to begin analysis.")
app.py+19-20