inquery for st.chat_input: Example 4: Programmatically set the text via session state

Please take a moment to search the forum and documentation before posting a new topic.
If you’re creating a debugging post, please include the following info:

  1. Are you running your app locally or is it deployed? Both
  2. If your app is deployed:
    a. Is it deployed on Community Cloud or another hosting platform? AWS
    b. Share the link to the public deployed app. Not possible
  3. Share the link to your app’s public GitHub repository (including a requirements file). Sorry
  4. Share the full text of the error message (not a screenshot). –> –> streamlit.errors.StreamlitValueAssignmentNotAllowedError: Values for the widget with key ‘chat_input’ cannot be set using st.session_state.
  5. Share the Streamlit and Python versions. Streamlit == 1.49.0, Python == 3.11.0

I can execute the example on Streamlit 1.49.1 and Python 3.13. Are you saying that you get this error if you copy the example exactly, without modifying it? Can you write a statement in your app to write st.__version__? This is an expected error for any version less than 1.47.0 so it would be good to confirm there is no mix up between Python environments.