Chatbot component

this is the part of my rasa chat bot user interface in streamlit.
when i click button …button click function is called. when it comes to full screen is getting refreshed after that getting bot response(all icons ,text slowly disappear and appear). is there anyway to stop this refresh . Thanks

button_clicked = st.button(button_title, key=payload, on_click=lambda b=button: on_button_click(b))

def on_button_click(button):
cleaned_payload = button[“payload”].lstrip(‘/’)
payload_response =“http://localhost:5005/webhooks/rest/webhook",json={"message”: cleaned_payload})
payload_bot_reply = payload_response.json()

# Display the response from Rasa after clicking the button
if payload_bot_reply:
    payload_bot_response = payload_bot_reply[0].get("text", "")    
    st.session_state.messages.append({"role": "assistant", "content": f"Bot: {payload_bot_response}"})

streamlitVersion: 1.29.0

Your version looks updated, you can check this doc to understand widget behavior it might help

thanks for directing right place .i read …but could not find answer to my case. could you please direct me more close my problem. Thanks

when i call this …screen refresh

payload_response =“http://localhost:5005/webhooks/rest/webhook",json={"message”: cleaned_payload})


    for button_info in button_info_list:
        button_title = button_info.get("title", "")
        payload = button_info.get("payload", "").lstrip("/")        
        st.session_state.chkvalue = st.checkbox(label=button_title,  
                              key=payload,on_change=btnclick, args=[payload])
       if st.session_state.chkvalue :
           some code.....

how can i get value of st.session_state.chkvalue ie. true once the check box is clicked…after that want to process other code. this part if st.session_state.chkvalue : not reaching…please support. Thanks