I am trying to find the input and output transcrip...
# ask-ai
b
I am trying to find the input and output transcriptions when using gemini realtime model. Can you help me find it?
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.
Here’s a quick guide to help you access input and output transcriptions when using the Gemini realtime model: • Configuration: Just enable transcriptions by setting
input_audio_transcription
and
output_audio_transcription
when you initialize the
RealtimeModel
. It looks like this:
Copy code
from livekit.plugins import google
from google.genai import types

model = google.beta.realtime.RealtimeModel(
    input_audio_transcription=types.AudioTranscriptionConfig(),
    output_audio_transcription=types.AudioTranscriptionConfig(),
)
• Getting Your Transcriptions: ◦ Input transcriptions come through as
input_audio_transcription_completed
events. ◦ Output transcriptions show up when the server sends
output_transcription
content. • Frontend Access: You’ll find transcriptions published to the frontend using LiveKit’s text streams under the topic
lk.transcription
. If you want me to walk you through any part of this or have questions, just let me know—I’m here to help! Sources: livekit-plugins/livekit-plugins-openai/livekit/plugins/openai/realtime/real... | Text and transcriptions | LiveKit Docs
b
i currently efine my agent like this. how shoul i change it so the transcription works? ession = AgentSession( userdata=HermesUserData( ctx=ctx, session_id=session_id, caller_phone=caller_phone ), llm=google.beta.realtime.RealtimeModel( api_key="XX", model="gemini-2.5-flash-live-preview", api_version="v1beta", language="en-IN", voice="Aoede", input_audio_transcription=types.AudioTranscriptionConfig(), output_audio_transcription=types.AudioTranscriptionConfig(), ), vad=silero.VAD.load(), tts=google.TTS( language="en-IN", voice_name="en-IN-Chirp3-HD-Aoede", gender="female" ), ) it says types is not defined
t
Hey there! That "types is not defined" error pops up because the
types
module from Google's genai library hasn’t been imported yet. No worries though—just add this line at the top of your file:
Copy code
from google.genai import types
After that, your transcription setup should work smoothly. If you run into any other hiccups, feel free to reach out—I’m here to help! Sources: livekit-plugins/livekit-plugins-openai/livekit/plugins/openai/stt.py
b
and can you give me simple code i can drop in which will help me show the transcriptions (both in and out) in my console?
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!