Update app.py
Browse files
app.py
CHANGED
|
@@ -173,7 +173,6 @@ if "chat_complete" not in st.session_state:
|
|
| 173 |
st.session_state.chat_complete = False
|
| 174 |
if "messages" not in st.session_state:
|
| 175 |
st.session_state.messages = []
|
| 176 |
-
st.session_state["openai_model"] = "gpt-4o"
|
| 177 |
|
| 178 |
# Helper functions to update session state
|
| 179 |
def complete_setup():
|
|
@@ -250,6 +249,10 @@ if st.session_state.setup_complete and not st.session_state.chat_complete:
|
|
| 250 |
# Initialize OpenAI client
|
| 251 |
client = OpenAI(api_key=st.secrets["OPENAI_API_KEY"])
|
| 252 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 253 |
# Initializing the system prompt for the chatbot
|
| 254 |
if not st.session_state.messages:
|
| 255 |
st.session_state.messages = [{
|
|
|
|
| 173 |
st.session_state.chat_complete = False
|
| 174 |
if "messages" not in st.session_state:
|
| 175 |
st.session_state.messages = []
|
|
|
|
| 176 |
|
| 177 |
# Helper functions to update session state
|
| 178 |
def complete_setup():
|
|
|
|
| 249 |
# Initialize OpenAI client
|
| 250 |
client = OpenAI(api_key=st.secrets["OPENAI_API_KEY"])
|
| 251 |
|
| 252 |
+
# Setting OpenAI model if not already initialized
|
| 253 |
+
if "openai_model" not in st.session_state:
|
| 254 |
+
st.session_state["openai_model"] = "gpt-4o"
|
| 255 |
+
|
| 256 |
# Initializing the system prompt for the chatbot
|
| 257 |
if not st.session_state.messages:
|
| 258 |
st.session_state.messages = [{
|