Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
# Importing required packages
|
| 2 |
import streamlit as st
|
| 3 |
import openai
|
| 4 |
import uuid
|
|
@@ -111,7 +111,7 @@ def page1():
|
|
| 111 |
st.session_state.chat_history.append(("User", question))
|
| 112 |
process_question(question)
|
| 113 |
|
| 114 |
-
# Function to process the question
|
| 115 |
def process_question(question):
|
| 116 |
# Add message to the thread
|
| 117 |
st.session_state.messages = client.beta.threads.messages.create(
|
|
@@ -131,16 +131,6 @@ def page1():
|
|
| 131 |
time.sleep(1) # Wait 1 second before checking run status
|
| 132 |
st.rerun()
|
| 133 |
|
| 134 |
-
|
| 135 |
-
# Display chat history in Streamlit chat format
|
| 136 |
-
for role, message in st.session_state.chat_history:
|
| 137 |
-
if role == "User":
|
| 138 |
-
with st.chat_message("User"):
|
| 139 |
-
st.markdown(message)
|
| 140 |
-
elif role == "Assistant":
|
| 141 |
-
with st.chat_message("Assistant"):
|
| 142 |
-
st.markdown(message)
|
| 143 |
-
|
| 144 |
# Example query buttons
|
| 145 |
col3, col4 = st.columns(2) # Create two columns for buttons
|
| 146 |
|
|
|
|
| 1 |
+
# Importing required packages
|
| 2 |
import streamlit as st
|
| 3 |
import openai
|
| 4 |
import uuid
|
|
|
|
| 111 |
st.session_state.chat_history.append(("User", question))
|
| 112 |
process_question(question)
|
| 113 |
|
| 114 |
+
# Function to process the question
|
| 115 |
def process_question(question):
|
| 116 |
# Add message to the thread
|
| 117 |
st.session_state.messages = client.beta.threads.messages.create(
|
|
|
|
| 131 |
time.sleep(1) # Wait 1 second before checking run status
|
| 132 |
st.rerun()
|
| 133 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 134 |
# Example query buttons
|
| 135 |
col3, col4 = st.columns(2) # Create two columns for buttons
|
| 136 |
|