Manasa1 commited on
Commit
200a5eb
Β·
verified Β·
1 Parent(s): 841f853

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -20
app.py CHANGED
@@ -17,29 +17,29 @@ if API_KEY:
17
 
18
  # Page configuration
19
  st.set_page_config(
20
- page_title="Multimodal AI Agent- Video Summarizer",
21
  page_icon="πŸŽ₯",
22
  layout="wide"
23
  )
24
 
25
- st.title("Phidata Video AI Summarizer Agent πŸŽ₯πŸŽ€πŸ–¬")
26
  st.header("Powered by Gemini 2.0 Flash Exp")
27
 
28
  @st.cache_resource
29
  def initialize_agent():
30
  return Agent(
31
- name="Video AI Summarizer",
32
- model=Gemini(id="gemini-2.0-flash-exp"),
33
  tools=[DuckDuckGo()],
34
  markdown=True,
35
  )
36
 
37
- ## Initialize the agent
38
  multimodal_Agent = initialize_agent()
39
 
40
  # File uploader
41
  video_file = st.file_uploader(
42
- "Upload a video file", type=['mp4', 'mov', 'avi'], help="Upload a video for AI analysis"
43
  )
44
 
45
  if video_file:
@@ -67,26 +67,26 @@ if video_file:
67
  time.sleep(1)
68
  processed_video = get_file(processed_video.name)
69
 
70
- # Enhanced prompt for detailed paragraph-style student notes
71
  analysis_prompt = (
72
  f"""
73
- Analyze the uploaded video thoroughly and create EXTREMELY DETAILED STUDENT NOTES in full paragraph format.
74
-
75
  Your notes should:
76
- - Begin with a thorough introduction to the topic
77
- - Use full, detailed paragraphs (NOT bullet points) to explain concepts
78
- - Structure the content with clear headings and subheadings
79
- - Include detailed explanations and elaborations on key concepts
80
- - Connect ideas using transition sentences between paragraphs
81
- - Use complete sentences and proper grammar throughout
82
- - Create a cohesive narrative flow like detailed textbook content
83
- - Include a conclusion paragraph summarizing the main points
84
 
85
- IMPORTANT: Do NOT use bullet points or lists. Present all information in well-developed paragraphs.
86
 
87
  Additional context/question from user: {user_query}
88
 
89
- The notes should read like detailed textbook content that thoroughly explains all concepts from the video.
90
  """
91
  )
92
 
@@ -112,4 +112,3 @@ if video_file:
112
  Path(video_path).unlink(missing_ok=True)
113
  else:
114
  st.info("Upload a video file to begin analysis.")
115
-
 
17
 
18
  # Page configuration
19
  st.set_page_config(
20
+ page_title="Multimodal AI Agent Video Notes Writer",
21
  page_icon="πŸŽ₯",
22
  layout="wide"
23
  )
24
 
25
+ st.title("Phidata Video AI Notes Writer πŸŽ₯πŸŽ€πŸ–¬")
26
  st.header("Powered by Gemini 2.0 Flash Exp")
27
 
28
  @st.cache_resource
29
  def initialize_agent():
30
  return Agent(
31
+ name="Video AI Notes-Writer",
32
+ model=Gemini(id="Gemini-2.0-flash-exp"),
33
  tools=[DuckDuckGo()],
34
  markdown=True,
35
  )
36
 
37
+ # Initialize the agent
38
  multimodal_Agent = initialize_agent()
39
 
40
  # File uploader
41
  video_file = st.file_uploader(
42
+ "Upload a video file", type=['mp4'], help="Upload a video for AI analysis"
43
  )
44
 
45
  if video_file:
 
67
  time.sleep(1)
68
  processed_video = get_file(processed_video.name)
69
 
70
+ # Enhanced prompt for detailed student-style notes with improved structure
71
  analysis_prompt = (
72
  f"""
73
+ Analyze the uploaded video thoroughly and generate EXTREMELY DETAILED STUDENT NOTES in full paragraph format.
74
+
75
  Your notes should:
76
+ - Begin with a comprehensive introduction that outlines the topic and objectives.
77
+ - Divide the content into clearly labeled sections with headings and subheadings (e.g., "Introduction", "Main Concepts", "Detailed Explanations", and "Conclusion").
78
+ - Provide detailed explanations of key concepts, ensuring each section includes a narrative summary of its key takeaways.
79
+ - Include smooth transitions between sections and paragraphs for a cohesive flow.
80
+ - Reference and explain any visual aids, diagrams, or slides mentioned in the lecture.
81
+ - Incorporate reflective questions or critical insights to prompt further analysis of the material.
82
+ - Maintain a student-friendly yet rigorous tone, similar to well-structured textbook content.
83
+ - Conclude with a summary paragraph that encapsulates the main ideas.
84
 
85
+ IMPORTANT: DO NOT use bullet points or lists. Present all information in well-developed paragraphs.
86
 
87
  Additional context/question from user: {user_query}
88
 
89
+ The final output should resemble detailed, structured textbook content that thoroughly explains all concepts from the video.
90
  """
91
  )
92
 
 
112
  Path(video_path).unlink(missing_ok=True)
113
  else:
114
  st.info("Upload a video file to begin analysis.")