I want to change chat_input text with Python. Is that now possible? thanks
If you want to programmatically set the value of the widget, that isn’t possible. Like st.button, you can’t set the value of st.chat_input through Session State.
If you want to modify the placeholder text in the widget, that’s the first parameter of the command .
Will that be possible in the future? It would be a necessary feature.
I tried text_input, but the position is always before the chat not after it like with
Chat_input.
I recommend putting in a feature request through GitHub and explaining your use case to help the devs prioritize additions and changes.
Thanks.
There is already an issue
opened 07:02AM - 13 Aug 23 UTC
type:enhancement
feature:st.chat_input
### Checklist
- [X] I have searched the [existing issues](https://github.com/st… reamlit/streamlit/issues) for similar feature requests.
- [X] I added a descriptive title and summary to this issue.
### Summary
I propose to add a parameter to `st.chat_input` that allows for the customization of the user prompt, similar to the `value` parameter of `st.text_input`.
### Why?
I have been working on an LLM that is built on top of ChatGPT. On the App page, there's a dropdown of prompt examples that users can choose from, and once they select a prompt, it should automatically appear in the `st.chat_input` box (similar to the prompt examples ChatGPT provides). Unfortunately, there is currently no way to set a custom prompt for `st.chat_input`. As this is a common practice for UIs of chat models, this functionality could be extremely helpful for a lot of applications.
### How?
I currently don't have much time to understand the details of `st.chat_input`'s implementation, but I suppose it is at least somewhat similar to how `st.text_input` is implemented. I think the team can look into how the `value` parameter is handled in `st.text_input` and use it as a reference for this functionality.
### Additional Context
_No response_