chainlit
chainlit copied to clipboard
Feature request: Bind Actions / Ask Users to the TextArea input menu
What: Allow devs to place actions into chat bar like Chat GPT
-
Action buttons can be display in chat window
-
Action buttons can not be
pinned
Solution
One possibility is to pin them to the left of the input
box
import chainlit as cl
@cl.action_callback("action_button")
def on_action(action):
cl.Message(content=f"Executed {action.name}").send()
# Optionally remove the action button from the chatbot user interface
action.remove()
@cl.on_chat_start
def start():
# Sending an action button within a chatbot message
actions = [
cl.Action(
name="action_button",
value="example_value",
description="Click me!",
icon="icon-name"
)
]
cl.TextArea(actions=actions).build()
cl.Message(content="Interact with this action button:", actions=actions).send()
Could set an icon to an action and show the actions name as alt text when hovering.
Requirements
- Be able to
ask user
: upload a file at any point for the LLM from the text area. (like Code Interpreter) - Be able to trigger action at any point from the text area.
Thank you for the feature request and design proposal! This is very interesting and would probably be part of the broader effort on Elements and Actions :)
+1