We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When using st.chat_input to enter a message, the message sometimes disappears immediately after input.
This issue did not occur before the introduction of streamlit_authenticator, but it started happening after its integration.
I suspect that something is causing a rerun after message input, which might be leading to the disappearance of the entered message.
import streamlit as st import openai import os import yaml from yaml.loader import SafeLoader import streamlit_authenticator as stauth openai.api_key = os.environ["OPENAI_API_KEY"] USER_NAME = "user" ASSISTANT_NAME = "assistant" with open('./config.yaml') as file: config = yaml.load(file, Loader=SafeLoader) usernames = ["****"] passwords = ["****"] user_dict = {username: {'name': username, 'password': passwords} for username, passwords in zip(usernames, passwords)} credentials = {'usernames': user_dict} authenticator = stauth.Authenticate( credentials, config['cookie']['name'], config['cookie']['key'], config['cookie']['expiry_days'], config['preauthorized'] ) name, authentication_status, username = authenticator.login('Login', 'main') def show_chat_log(): **** def chat_log_to_text(): **** def response_chatgpt(): **** def logged_in_page(): user_message = st.chat_input("input your message") if user_message: show_chat_log() with st.chat_message(USER_NAME): st.write(user_message) response = response_chatgpt( user_message, ) with st.chat_message(ASSISTANT_NAME): **** if st.session_state["authentication_status"]: st.write(f'Welcome *{st.session_state["name"]}*') authenticator.logout('Logout', 'main', key='unique_key') logged_in_page() elif st.session_state["authentication_status"] is False: st.error('Username/password is incorrect') elif st.session_state["authentication_status"] is None: st.warning('Please enter your username and password')
@mkhorasani can you please help, would be greatly appreciated
The text was updated successfully, but these errors were encountered:
I will be closing this issue, and request that you kindly follow developments in #99.
Sorry, something went wrong.
No branches or pull requests
Summary
When using st.chat_input to enter a message, the message sometimes disappears immediately after input.
Video
2023-11-13.16.58.30.mov
Investigation
This issue did not occur before the introduction of streamlit_authenticator, but it started happening after its integration.
Hypothesis
I suspect that something is causing a rerun after message input, which might be leading to the disappearance of the entered message.
Sample code
@mkhorasani can you please help, would be greatly appreciated
The text was updated successfully, but these errors were encountered: