clever-doctor-15083
11/07/2025, 6:06 AMtall-airline-16756
11/07/2025, 6:07 AMtall-airline-16756
11/07/2025, 6:07 AMis_final: bool that tells you if the transcript is final.
• conversation_item_added: This one triggers when an item, like user input, is officially added to the chat history.
If you’d like, I’m here to help with a specific implementation or if you need any more details—just let me know!
Sources: Events and error handling | LiveKit docs | livekit-agents/livekit/agents/stt/stream_adapter.py | agents/src/stt/stt.tsclever-doctor-15083
11/07/2025, 6:08 AMtall-airline-16756
11/07/2025, 6:09 AMAgentSession within your LiveKit room context.
2. Next, make sure to register your event handlers before you start the session.
3. You can use the on method to define what should happen when each event occurs.
Here's a friendly example to guide you:
from livekit.agents import JobContext, AgentSession, UserInputTranscribedEvent, ConversationItemAddedEvent
async def entrypoint(ctx: JobContext):
await ctx.connect()
session = AgentSession()
@session.on("user_input_transcribed")
def on_user_input_transcribed(event: UserInputTranscribedEvent):
print(f"User said: {event.transcript}, Final: {event.is_final}")
@session.on("conversation_item_added")
def on_conversation_item_added(event: ConversationItemAddedEvent):
print(f"New conversation item: {event.item.text_content}")
await session.start(agent=YourAgent(), room=ctx.room)
If you have any questions or would like me to walk you through a more detailed example, please don’t hesitate to ask. I’m here to help!
Sources: pipeline-stt/transcriber/README.md | tests/test_agent_session.py | Events and error handling | LiveKit docs | Session recording and transcripts | LiveKit Docs