My application takes a query, runs it through the model and answers the query. I want to add an option where the user can see suggestion from a dropdown and if selected directly outputs the answer, but if a user doesnt select from the dropdown, they can type their own query which will run through the model
What I need is:
user would like a pre-canned list, but the option to enter anything custom (a question that wasnt there in the list).
It would be great if the selectbox can be also used as text_input
is there a way around this?
I was hoping something along these line, where you can choose a query from the dropdown list, but if you dont find your query in the dropdown, you can go ahead and enter your own query.
Wherein (text_input) only lets you input a query, and st.selectbox only lets you pick the query from a given list.
I did go through streamlit tags, doesnt apply to my use case!
def st_tags(value: list,
suggestions: list,
label: str,
text: str,
maxtags: int,
key=None) -> list:
'''
:param maxtags: Maximum number of tags allowed maxtags = -1 for unlimited entries
:param suggestions: (List) List of possible suggestions (optional)
:param label: (Str) Label of the Function
:param text: (Str) Instructions for entry
:param value: (List) Initial Value (optional)
:param key: (Str)
An optional string to use as the unique key for the widget.
Assign a key so the component is not remount every time the script is rerun.
:return: (List) Tags
Note: usage also supports keywords = st_tags()```
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.