Spaces:
Runtime error
Runtime error
Commit
·
cbb3419
1
Parent(s):
5a4fac6
update app
Browse files
app.py
CHANGED
@@ -1,3 +1,4 @@
|
|
|
|
1 |
import streamlit as st
|
2 |
from openai import OpenAI # TODO: Install the OpenAI library using pip install openai
|
3 |
from streamlit import secrets
|
@@ -6,7 +7,7 @@ st.title("Mini Project 2: Streamlit Chatbot")
|
|
6 |
|
7 |
# TODO: Replace with your actual OpenAI API key
|
8 |
# client = OpenAI(api_key='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')
|
9 |
-
client = OpenAI(api_key=
|
10 |
|
11 |
# Define a function to get the conversation history (Not required for Part-2, will be useful in Part-3)
|
12 |
# def get_conversation():
|
|
|
1 |
+
# Import the necessary libraries
|
2 |
import streamlit as st
|
3 |
from openai import OpenAI # TODO: Install the OpenAI library using pip install openai
|
4 |
from streamlit import secrets
|
|
|
7 |
|
8 |
# TODO: Replace with your actual OpenAI API key
|
9 |
# client = OpenAI(api_key='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')
|
10 |
+
client = OpenAI(api_key=st.secrets["OPENAI_API_KEY"])
|
11 |
|
12 |
# Define a function to get the conversation history (Not required for Part-2, will be useful in Part-3)
|
13 |
# def get_conversation():
|