stevafernandes commited on
Commit
86050e0
·
verified ·
1 Parent(s): 5dd9698

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -6,8 +6,12 @@ import time
6
  import mimetypes
7
  from pathlib import Path
8
 
9
- # Gemini API key (hardcoded for demo purposes)
10
- GEMINI_API_KEY = "AIzaSyDCMPwXHagWqYTQB3HL7FceHEmKUv3v4wc"
 
 
 
 
11
  genai.configure(api_key=GEMINI_API_KEY)
12
 
13
  st.set_page_config(page_title="Video RAG with Gemini", page_icon="🎬", layout="wide")
@@ -71,7 +75,7 @@ with st.sidebar:
71
  if st.button("Reset All"):
72
  st.session_state.clear()
73
 
74
- st.title("🎬 Video RAG with Gemini")
75
 
76
  if not st.session_state.video_file:
77
  st.info("👈 Upload a video to start chatting")
 
6
  import mimetypes
7
  from pathlib import Path
8
 
9
+ # Sidebar API key input
10
+ with st.sidebar:
11
+ user_api_key = st.text_input("Enter your Gemini API key (optional):", type="password")
12
+
13
+ # Gemini API key configuration
14
+ GEMINI_API_KEY = user_api_key if user_api_key else "AIzaSyDCMPwXHagWqYTQB3HL7FceHEmKUv3v4wc"
15
  genai.configure(api_key=GEMINI_API_KEY)
16
 
17
  st.set_page_config(page_title="Video RAG with Gemini", page_icon="🎬", layout="wide")
 
75
  if st.button("Reset All"):
76
  st.session_state.clear()
77
 
78
+ st.title("Video Retrieval-Augmented Generation - Gemini 2.0")
79
 
80
  if not st.session_state.video_file:
81
  st.info("👈 Upload a video to start chatting")