chainlit icon indicating copy to clipboard operation
chainlit copied to clipboard

Can not show Action on User message

Open nqthiep opened this issue 7 months ago • 0 comments

Describe the bug I add Action on User message which user inputted, but Action does not display

To Reproduce

@cl.on_message
async def on_message(message: cl.Message):
    message.actions = [
        cl.Action(
            name="human_action_button",
            value="example_value",
            description="Human message - Action!",
        )
    ]
    message.elements = [cl.Text(content="Element of human message")]
    await message.update()

    new_message = cl.Message(content="Assistant Message")
    await new_message.send()
    new_message.actions = [
        cl.Action(
            name="assistant_action_button",
            value="example_value",
            description="Assistant message - Action!",
        )
    ]
    new_message.elements = [cl.Text(content="Element of assistant message")]
    await new_message.update()

Expected behavior Action on User message display.

Screenshots Screen Shot 2024-07-16 at 21 05 47

Desktop (please complete the following information):

  • OS: [MacOS, Ubuntu]
  • Browser [chrome]

Additional context

  • I add Action on Assistant message and System message, it still display.
  • I add Text Element on User message, Assistant message and System message, it still display.

nqthiep avatar Jul 16 '24 14:07 nqthiep