Best way to make first screen have example queries
I'm looking for a way (ideally using the default markdown page) to have a few example queries that the user can click on to initiate a conversation with the chatbot. Is there some magic #-link or javascript callout that I could set the url to to make this happen? If not, I feel like it would be a really useful addition. I assume that I can do this using the on_chat_start function and various elements, however it would be very sweet to be able to do it purely from markdown.
Seems like they were already working on this feature. Currently it's in pre-release: https://docs.chainlit.io/guides/migration/1.1.300rc0#new-feature-starters
I followed the migration guide but the starters are not working I created the starters.py in the same directory as app.py and then run chainlit run command but nothing worked.
https://docs.chainlit.io/guides/migration/1.1.300#new-feature-starters
Hello, you can copy this code snippet :
import chainlit as cl
@cl.set_starters
async def set_starters():
return [
cl.Starter(
label="Morning routine ideation",
message="Can you help me create a personalized morning routine that would help increase my productivity throughout the day? Start by asking me about my current habits and what activities energize me in the morning.",
icon="/public/idea.svg",
),
cl.Starter(
label="Explain superconductors",
message="Explain superconductors like I'm five years old.",
icon="/public/learn.svg",
),
cl.Starter(
label="Python script for daily email reports",
message="Write a script to automate sending daily email reports in Python, and walk me through how I would set it up.",
icon="/public/terminal.svg",
),
cl.Starter(
label="Text inviting friend to wedding",
message="Write a text asking a friend to be my plus-one at a wedding next month. I want to keep it super short and casual, and offer an out.",
icon="/public/write.svg",
)
]
# ...
how can we have Starters with welcome message like, Hello <User>, you can try below examples? I am using Action button with welcome message but the issue is, when user clicks on it, it does not appear as user message instead it shows the answer.
You can see it tried to answer but it did not log as user query. Just an example I have asked "who is this" and it is logged as user query.