is there an event that fires on text messages? `on...
# ask-ai
r
is there an event that fires on text messages?
on_user_turn_completed
is for STT node only
t
Thanks for reaching out, Ivan. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — regarding the event for text messages: use the conversation_item_added event. •
on_user_turn_completed
is specific to STT (speech) turns. •
conversation_item_added
fires for any conversation message, including text messages sent via
lk.chat
. Listen on the
AgentSession
to handle incoming text. If you want direct control over text input handling, you can also set a
text_input_cb
in
RoomOptions
to process messages as they arrive. Would you like a short code example for your language (Python/Node) showing how to listen for
conversation_item_added
? Sources: Text and transcriptions | LiveKit docs | Agent session | LiveKit docs
r
show me a boilerplate implementation of
text_input_cb
t
I don't have the answer you're looking for. You could also try asking your question: • in one of the other Slack channels or • to https://deepwiki.com/livekit/livekit_composite which is trained on all LiveKit source code If you find the answer, please post it here to help others!