happy-mouse-590
08/22/2025, 3:23 AMtall-airline-16756
08/22/2025, 3:23 AMtall-airline-16756
08/22/2025, 3:24 AMagent.py with these handy methods:
• Using `session.history`: This lets you grab the full conversation history for the session through the session.history property.
• Listening to events: Want real-time updates? Just listen for events like conversation_item_added (for new chat messages) or user_input_transcribed (when user input gets transcribed).
• Using `transcription_node`: If you’re working with a TTS provider, the transcription_node method helps you access synchronized, timed transcriptions.
• Saving transcripts on session shutdown: You can save the conversation history when the session ends by using add_shutdown_callback.
If you want me to walk you through any of these or need some examples, just let me know—I’m here to help!
Sources: complex-agents/teleprompter/cartesia-ink.py | examples/other/transcription/transcriber.py | How to capture real-time agent transcriptions during conversations | Session recording and transcripts | LiveKit Docs | Workflows | LiveKit Docshappy-mouse-590
08/22/2025, 3:24 AMtall-airline-16756
08/22/2025, 3:25 AMvars(self.chat_ctx).get('_items', []) to access chat items. I’d recommend steering clear of that approach because it skips the intended API and might cause hiccups if the internal setup changes down the line.
Instead, try using self.chat_ctx.items to get your chat items. This way, you’re sticking to the documented interface and keeping things compatible with the read-only nature of the chat context. And if you ever need to update the chat context, the best way is to use the agent’s update_chat_ctx method — it’s designed to handle conversation history updates smoothly.
Feel free to reach out if you want me to walk you through updating your implementation or if you have any other questions. I’m here to help!
Sources: livekit-plugins/livekit-plugins-google/livekit/plugins/google/beta/realtime...