Spaces:
Runtime error
Runtime error
Commit
·
5a4fac6
1
Parent(s):
966c7cf
update app
Browse files
app.py
CHANGED
@@ -1,11 +1,12 @@
|
|
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 |
|
5 |
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 |
|
10 |
# Define a function to get the conversation history (Not required for Part-2, will be useful in Part-3)
|
11 |
# def get_conversation():
|
|
|
|
|
1 |
import streamlit as st
|
2 |
from openai import OpenAI # TODO: Install the OpenAI library using pip install openai
|
3 |
+
from streamlit import secrets
|
4 |
|
5 |
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=os.getenv("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():
|