Please help me solve this problem:
- deployed app https://positive-pravnik.streamlit.app/
Github repo : GitHub - djordjethai/NeoChatbot - No error shown, only stop working in this code:
The script runs completely without errors on localhost, but when deployed on Streamlit cloud - it sometimes (it seems to be completely random) runs briefly, then stops and doesn’t give any kind of output, nor is there anything in the Streamlit logs.
After troubleshooting, I came to a conclusion that the prompt itself gets lost in the server side communication, because at one point it just becomes None (in the same run of the script, no user interaction in-between).
The question is generated the usual way; the following code isn’t directly dependent on e.g. some st.button or similar, it will run every time if a thread is entered:
if prompt := st.chat_input(placeholder="Enter the question"):
if st.session_state.thread_id is not None:
client.beta.threads.messages.create(thread_id=st.session_state.thread_id, role="user", content=prompt)
run = client.beta.threads.runs.create(thread_id=st.session_state.thread_id, assistant_id=assistant.id,
instructions=instructions)
else:
st.warning("No chat was selected.")
Later parts of the code can’t be reached because a run can’t be used without an actual message.
The runs without an output aren’t related to some specific user actions or questions - they also aren’t periodical.
- Streamlit 1.29.0 and Python 3.11
Thank you.