Skip to content

Agent is not able to access the options sent from sendText() #459

@vnandan

Description

@vnandan

My JS frontend sends a text message using sendText() with the topic lk.chat and some attributes.

The Python agent can access this text message using def on_conversation_item_added(ev: ConversationItemAddedEvent) but this does not give access to the attributes passed from the frontend.

I think think the ChatMessage class or the ConversationItemAddedEvent should be carrying it but I checked but neither of them are.

This is causing significant issues when trying to pass data associated with a text message.

I’ve also tried assigning a handler for the lk.chat on the ctx.room.register_text_stream_handler('lk.chat', handle_text_stream). But I get the error : text stream handler for topic 'lk.chat' already set which is expected.

I also can't use a random topic to send the message cause I want all the default behaviour of the AI agent that comes with lk.chat to work as it normally does.

The options property will need to be added to the ChatMessage or the ConversationItemAddedEvent definition i think.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions