Spaces:
Sleeping
Sleeping
CB commited on
Update streamlit_app.py
Browse files- streamlit_app.py +13 -4
streamlit_app.py
CHANGED
|
@@ -254,7 +254,7 @@ safety_settings = [
|
|
| 254 |
]
|
| 255 |
|
| 256 |
# ---- Upload & processing helpers ----
|
| 257 |
-
def upload_video_sdk(filepath: str
|
| 258 |
key = get_effective_api_key()
|
| 259 |
if not key:
|
| 260 |
raise RuntimeError("No API key provided")
|
|
@@ -263,7 +263,12 @@ def upload_video_sdk(filepath: str, rag_store_name: str = "default_store"):
|
|
| 263 |
genai.configure(api_key=key)
|
| 264 |
|
| 265 |
# Include the ragStoreName parameter
|
| 266 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 267 |
|
| 268 |
def wait_for_processed(file_obj, timeout: int = None):
|
| 269 |
if timeout is None:
|
|
@@ -442,8 +447,12 @@ if generate_now and not st.session_state.get("busy"):
|
|
| 442 |
local_path = current_path
|
| 443 |
upload_path, compressed = compress_video_if_large(local_path, threshold_mb=st.session_state.get("compress_threshold_mb", 200))
|
| 444 |
|
| 445 |
-
|
| 446 |
-
rag_store_name = "your_rag_store_name" #
|
|
|
|
|
|
|
|
|
|
|
|
|
| 447 |
|
| 448 |
with st.spinner(f"Uploading video{' (compressed)' if compressed else ''}..."):
|
| 449 |
try:
|
|
|
|
| 254 |
]
|
| 255 |
|
| 256 |
# ---- Upload & processing helpers ----
|
| 257 |
+
def upload_video_sdk(filepath: str):
|
| 258 |
key = get_effective_api_key()
|
| 259 |
if not key:
|
| 260 |
raise RuntimeError("No API key provided")
|
|
|
|
| 263 |
genai.configure(api_key=key)
|
| 264 |
|
| 265 |
# Include the ragStoreName parameter
|
| 266 |
+
rag_config = {
|
| 267 |
+
'ragStoreName': 'your_rag_store_name' # Specify your ragStoreName here
|
| 268 |
+
}
|
| 269 |
+
genai.configure_rag_context(rag_config) # Hypothetical function to configure
|
| 270 |
+
|
| 271 |
+
return upload_file(filepath) # Ensure this is the correct call function
|
| 272 |
|
| 273 |
def wait_for_processed(file_obj, timeout: int = None):
|
| 274 |
if timeout is None:
|
|
|
|
| 447 |
local_path = current_path
|
| 448 |
upload_path, compressed = compress_video_if_large(local_path, threshold_mb=st.session_state.get("compress_threshold_mb", 200))
|
| 449 |
|
| 450 |
+
# Set rag_store_name here
|
| 451 |
+
rag_store_name = "your_rag_store_name" # Set your ragStoreName here
|
| 452 |
+
|
| 453 |
+
# Configure the context for using RAG
|
| 454 |
+
try:
|
| 455 |
+
genai.configure_rag_context({'ragStoreName': rag_store_name}) # Hypothetical function
|
| 456 |
|
| 457 |
with st.spinner(f"Uploading video{' (compressed)' if compressed else ''}..."):
|
| 458 |
try:
|