Closed rtu-dataframe closed 11 months ago
Not sure I understand the question. If you want to send a specific prompt to your LLM and display the answer in the UI when a specific action is clicked you can write that logic in the cl.action_callback
.
import chainlit as cl
@cl.action_callback("action_button")
async def on_action(action):
response = # Call the LLM with a specific prompt
await cl.Message(content=response).send()
@cl.on_chat_start
async def start():
# Sending an action button within a chatbot message
actions = [
cl.Action(name="action_button", value="example_value", description="Click me!")
]
await cl.Message(content="Interact with this action button:", actions=actions).send()
Hi, using this action button, how i can use the click event to send a prompt (like as the user write it in the prompt field) to the LLM?
I'm looking for a simple and effective way to automate the send of some simple prompts using buttons, avoiding the user to write manually the prompt.
Many thanks