Spaces:
Runtime error
Runtime error
| import chainlit as cl | |
| async def start(): | |
| # Sending an action button within a chatbot message | |
| actions = [ | |
| cl.Action( | |
| name="summary_button", | |
| icon="mouse-pointer-click", | |
| payload={"value": "summary"}, | |
| label="Write summary" | |
| ), | |
| cl.Action( | |
| name="risk_button", | |
| icon="mouse-pointer-click", | |
| payload={"value": "risks"}, | |
| label="Write risk section" | |
| ), | |
| cl.Action( | |
| name="benefits_button", | |
| icon="mouse-pointer-click", | |
| payload={"value": "benefits"}, | |
| label="Write benefits section" | |
| ), | |
| cl.Action( | |
| name="file_button", | |
| icon="mouse-pointer-click", | |
| payload={"value": "markdown"}, | |
| label="Create final file" | |
| ) | |
| ] | |
| await cl.Message(content="Select consent form sections:", actions=actions).send() | |
| async def on_action(action: cl.Action): | |
| await cl.Message(content=f"Executed {action.payload["value"]}").send() | |
| await action.remove() | |
| async def on_action(action: cl.Action): | |
| await cl.Message(content=f"Executed {action.payload["value"]}").send() | |
| await action.remove() | |
| async def on_action(action: cl.Action): | |
| await cl.Message(content=f"Executed {action.payload["value"]}").send() | |
| await action.remove() | |
| async def on_action(action: cl.Action): | |
| await cl.Message(content=f"Executed {action.payload["value"]}").send() | |
| await action.remove() |