how to access the data in the transcription node? ...
# ask-ai
b
how to access the data in the transcription node? At the end of the call i am trying to get the summary of everything said by the customer and the agent. If i could also get some on.speech_event_complete or something like that, so i can log the responses and inputs that would be great.
t
Thanks for reaching out, Aryan. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Hey there! You can easily get transcription data and create a summary of everything said by both the customer and the agent using these handy methods: • Session History: Just use the
session.history
property to grab the full conversation history. You can even save this history to a file by using the
add_shutdown_callback
method once the session wraps up. • Real-time Event Listening: Keep an ear out for events like
conversation_item_added
(that’s when something new gets added to the chat history) and
user_input_transcribed
(which happens when user input is transcribed). • Separate Access Points: You can find AI agent transcripts at the
transcription_node
, and user transcripts come through the
user_input_transcribed
event. When it comes to logging responses and inputs, these events are super useful: • `user_speech_committed`: Captures the user’s speech as it’s added to the chat context • `agent_stopped_speaking`: Notifies when the agent finishes speaking •
user_started_speaking
and `user_stopped_speaking`: Perfect for tracking exactly when the user starts and stops talking If you want, I’d be happy to help you set up a specific logging pattern or guide you through accessing session history for summaries. Just let me know! Sources: VoicePipelineAgent | LiveKit Docs | Recording agent sessions | LiveKit Docs | Session recording and transcripts | LiveKit Docs | Understanding Transcript Timing in Voice Conversations
b
is this the same for realtime models like gemini realtime and openai realtime?
t
When it comes to accessing transcription data and logging, real-time models like Gemini Realtime and OpenAI Realtime work in pretty similar ways, though there are a few implementation differences worth noting: • Common Features: Both models send out events like
input_audio_transcription_completed
with pretty similar data structures, and they also handle transcription hiccups through error events. Usually, transcripts show up after the turn ends rather than word-by-word. • OpenAI Realtime: Offers events such as
input_speech_transcription_completed
and lets you tweak transcription options using
InputAudioTranscription
settings. • Gemini Realtime: Uses
input_audio_transcription
and
output_audio_transcription
settings, and marks the transcription as final only once the generation wraps up. Both models give you the flexibility to grab transcription data through event handlers, customize transcription settings, and manage success or failure smoothly. Are you working on a particular project with these models, or would you like some help figuring out which one might fit your transcription needs best? Sources: examples/voice_agents/gemini_video_agent.py | LiveKit turn detector plugin | LiveKit Docs | plugins/openai/src/realtime/realtime_model.ts
b
so if i wanted to access the transcription inside the input_audio_transcription_completed event what should I do? what all data is in the event? and where can i find the exact settings i can change using input_audio_transcripion and output_audio_transcription settigns?
t
Hey there! The
input_audio_transcription_completed
event gives you some handy info: • content_index: This tells you which part of the content it is. • event_id: A unique ID just for this event. • item_id: The ID for the conversation item. • transcript: The actual transcribed text from the audio. • type: Identifies the type of event. To catch this event, you just need to listen for it in your code. For example, in JavaScript, you can listen for the
input_speech_transcription_completed
event, which will give you the
itemId
and
transcript
. About transcription settings, you can set them up when you initialize things: • OpenAI Realtime: Use the
input_audio_transcription
setting, with defaults like
gpt-4o-mini-transcribe
or
whisper-1
if you’re working with Azure. • Google Realtime: You can configure this using
input_audio_transcription
and
output_audio_transcription
fields — if you don’t set them, they’ll default to
AudioTranscriptionConfig()
. Plus, you can update these transcription settings on the fly through session updates. If you want, I’m here to help you set this up or grab any specific data you need! Sources: SessionUpdateEvent | LiveKit Agents | ConversationItemInputAudioTranscriptionCompletedEvent | LiveKit Agents | plugins/openai/src/realtime/realtime_model.ts | livekit-plugins/livekit-plugins-openai/livekit/plugins/openai/realtime/real... | SessionResource | LiveKit Agents
b
i want to know what all configurations i can do for input_audio_transcription and output_audio_transcription for Google Realtime. i cant find the possible settings for it anywhere. Also give me the event contents for output_audio_transcription too
t
Hey there! When working with Google Realtime, the
input_audio_transcription
and
output_audio_transcription
settings use
types.AudioTranscriptionConfig
. If you don’t specify anything, they’ll both default to
AudioTranscriptionConfig()
. And if you want to turn off transcription, you can simply set them to
None
. You’ll pass these configurations when setting up the connection, and you can tweak them when you’re initializing the
RealtimeModel
. Just a heads-up—the exact details of what you can customize in
AudioTranscriptionConfig
aren’t fully spelled out in the sources, so it’s a good idea to check out the Google genai library documentation for the full scoop. About the
output_audio_transcription
event, here’s what it includes at a minimum: • text: The transcribed text from the output audio If you want, I’m here to help you set this up or dig into more details about the transcription features. Just let me know! Sources: livekit-plugins/livekit-plugins-aws/livekit/plugins/aws/experimental/realti...