Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,28 +1,5 @@
|
|
1 |
-
import os
|
2 |
-
from dotenv import load_dotenv
|
3 |
import chainlit as cl
|
4 |
|
5 |
-
# Load environment variables from .env file
|
6 |
-
load_dotenv()
|
7 |
-
|
8 |
-
# Debug: Print environment variables
|
9 |
-
print("Environment variables:")
|
10 |
-
for key, value in os.environ.items():
|
11 |
-
print(f"{key}: {value}")
|
12 |
-
|
13 |
-
# Check if API keys are loaded
|
14 |
-
GEMINI_API_KEY = os.getenv("GEMINI_API_KEY")
|
15 |
-
SERP_API_KEY = os.getenv("SERP_API_KEY")
|
16 |
-
|
17 |
-
if not GEMINI_API_KEY:
|
18 |
-
raise ValueError("GEMINI_API_KEY environment variable is not set")
|
19 |
-
if not SERP_API_KEY:
|
20 |
-
raise ValueError("SERP_API_KEY environment variable is not set")
|
21 |
-
|
22 |
-
print(f"GEMINI_API_KEY: {GEMINI_API_KEY}")
|
23 |
-
print(f"SERP_API_KEY: {SERP_API_KEY}")
|
24 |
-
|
25 |
-
# Chainlit app
|
26 |
@cl.on_chat_start
|
27 |
async def start():
|
28 |
await cl.Message(content="Hello! How can I assist you today?").send()
|
@@ -32,4 +9,4 @@ async def main(message: cl.Message):
|
|
32 |
await cl.Message(content=f"You said: {message.content}").send()
|
33 |
|
34 |
if __name__ == "__main__":
|
35 |
-
cl.run(
|
|
|
|
|
|
|
1 |
import chainlit as cl
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
@cl.on_chat_start
|
4 |
async def start():
|
5 |
await cl.Message(content="Hello! How can I assist you today?").send()
|
|
|
9 |
await cl.Message(content=f"You said: {message.content}").send()
|
10 |
|
11 |
if __name__ == "__main__":
|
12 |
+
cl.run(port=7860, debug=True)
|