Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -9,13 +9,13 @@ import os
|
|
9 |
import chainlit as cl
|
10 |
|
11 |
# Load environment variables from .env file
|
12 |
-
load_dotenv()
|
13 |
|
|
|
14 |
|
15 |
@cl.on_chat_start
|
16 |
async def start_llm():
|
17 |
llm = ChatOpenAI(model='gpt-4o-mini',
|
18 |
-
temperature=0.5)
|
19 |
conversation_memory = ConversationBufferMemory(memory_key="chat_history",
|
20 |
max_len=50,
|
21 |
return_messages=True,
|
|
|
9 |
import chainlit as cl
|
10 |
|
11 |
# Load environment variables from .env file
|
|
|
12 |
|
13 |
+
api_key = os.getenv('OPENAI_API_KEY')
|
14 |
|
15 |
@cl.on_chat_start
|
16 |
async def start_llm():
|
17 |
llm = ChatOpenAI(model='gpt-4o-mini',
|
18 |
+
temperature=0.5, api_key = api_key)
|
19 |
conversation_memory = ConversationBufferMemory(memory_key="chat_history",
|
20 |
max_len=50,
|
21 |
return_messages=True,
|