ok
Browse files
app.py
CHANGED
|
@@ -1525,10 +1525,13 @@ rag = WemaRAGSystem()
|
|
| 1525 |
rag.load() # Load your existing index
|
| 1526 |
|
| 1527 |
# Cell 3: Initialize API keys
|
| 1528 |
-
|
| 1529 |
|
| 1530 |
-
GOOGLE_API_KEY =
|
| 1531 |
-
SPITCH_API_KEY =
|
|
|
|
|
|
|
|
|
|
| 1532 |
|
| 1533 |
# Cell 4: Launch voice interface
|
| 1534 |
# The create_voice_gradio_interface function needs the chain, not the google_api_key directly.
|
|
|
|
| 1525 |
rag.load() # Load your existing index
|
| 1526 |
|
| 1527 |
# Cell 3: Initialize API keys
|
| 1528 |
+
import os
|
| 1529 |
|
| 1530 |
+
GOOGLE_API_KEY = os.getenv("GOOGLE_API_KEY")
|
| 1531 |
+
SPITCH_API_KEY = os.getenv("SPITCH_API_KEY")
|
| 1532 |
+
|
| 1533 |
+
if not GOOGLE_API_KEY or not SPITCH_API_KEY:
|
| 1534 |
+
raise ValueError("Missing one or more API keys. Make sure they are added as secrets in your Space.")
|
| 1535 |
|
| 1536 |
# Cell 4: Launch voice interface
|
| 1537 |
# The create_voice_gradio_interface function needs the chain, not the google_api_key directly.
|