boundless-author-7811
04/14/2026, 7:45 AMtall-airline-16756
04/14/2026, 7:45 AMtall-airline-16756
04/14/2026, 7:45 AMAudioInputOptions.noise_cancellation works with Realtime models.
Yes — noise cancellation configured in AudioInputOptions (e.g., BVC, BVCTelephony) is compatible with Realtime models. You can enable it in your room/agent session configuration so the enhanced audio processing improves turn detection and speech-to-text for Realtime integrations.
If you want, tell me which Realtime model and SDK/language you’re using and I’ll show the exact snippet to enable it.
Sources: Agent session | LiveKit Documentation | Sequential Pipeline Architecture for Voice Agents | LiveKit | Google AI and LiveKit | LiveKit Documentation | examples/voice_agents | livekit/livekit_composite | DeepWiki | Turns overview | LiveKit Documentation, with interactive elementsboundless-author-7811
04/14/2026, 7:48 AMtall-airline-16756
04/14/2026, 7:48 AMboundless-author-7811
04/14/2026, 7:51 AMtall-airline-16756
04/14/2026, 7:52 AMboundless-author-7811
04/14/2026, 1:22 PMtall-airline-16756
04/14/2026, 1:22 PMAgentSession snippet to the Gemini Live API equivalent and list required imports.
Required imports (example Python)
from livekit import agents
from livekit.agents import AgentSession
from livekit.plugins import noise_cancellation, google # google contains the Gemini Live plugin
Gemini-equivalent AgentSession
session = AgentSession[CallState](
llm=google.realtime.RealtimeModel(
model="gemini-2.5-flash-native-audio-preview-12-2025", # choose appropriate Gemini model
voice="Puck", # pick a supported Gemini voice
modalities=["AUDIO", "TEXT"], # Gemini uses these modality names
turn_detection=None, # disable server-side turn detection if desired
# Gemini does not support OpenAI's `input_audio_noise_reduction` parameter
api_key=deployment.api_key, # or use Vertex AI credentials instead
vertexai=False, # set True and provide project/location if using Vertex AI
),
vad=ctx.proc.userdata["vad"],
userdata=state,
ivr_detection=True,
user_away_timeout=15.0,
aec_warmup_duration=3.0,
turn_handling={
"interruption": {
"enabled": True,
"min_duration": 0.8,
"min_words": 2,
},
},
max_tool_steps=5,
)
Notes specific to noise reduction and SIP telephony
• input_audio_noise_reduction is OpenAI-specific and is not available for Gemini. Use LiveKit-side noise cancellation instead.
• For SIP telephony, use `BVCTelephony`/Krisp options via AudioInputOptions (or enable Krisp when creating trunks/participants) so telephony audio gets proper suppression.
If you want, paste your agent config or compose/k8s files (redact secrets) and I’ll produce exact edits/snippets to:
• remove cloud-only noise plugins,
• wire Gemini Live API credentials,
• enable telephony noise cancellation (BVCTelephony or Krisp) in your self-hosted setup. Sources: Azure OpenAI Realtime API and LiveKit | LiveKit Documentation | Turns overview | LiveKit Documentation | Using Noise Cancellation for SIP and WebRTC Participants | Gemini Live API plugin | LiveKit Documentation | Realtime model metrics | LiveKit Documentation, with interactive elementsboundless-author-7811
04/14/2026, 1:36 PMtall-airline-16756
04/14/2026, 1:37 PMgemini-2.5-flash-native-audio-preview-12-2025).
• Passing unsupported Realtime options. Remove any Gemini 3.1-only options like enable_affective_dialog, proactivity, or other server-side features not accepted by the model.
• Sending input_audio_noise_reduction or other OpenAI-specific params to Gemini. Gemini does not accept that parameter — handle noise reduction on the LiveKit side (BVCTelephony/Krisp).
• Missing or incorrect auth/config for Gemini:
◦ If using API key: ensure api_key is set and exported into the container as GOOGLE_API_KEY.
◦ If using Vertex AI: set vertexai=True, supply project and location, and mount GOOGLE_APPLICATION_CREDENTIALS.
• WebSocket payload framing issues due to invalid request fields cause the 1007 close. Cleaning the model config (above) usually resolves it.
Quick actionable changes to try
1. Change model to a Gemini 2.5 audio model and remove OpenAI-specific fields:
◦ Remove input_audio_noise_reduction.
◦ Remove any enable_affective_dialog / proactivity / nonstandard turn-detection flags.
1. Ensure auth:
◦ For API key mode: set api_key=deployment.api_key and export GOOGLE_API_KEY in your container.
◦ For Vertex AI: set vertexai=True, add project and location, and mount service account JSON via GOOGLE_APPLICATION_CREDENTIALS.
1. Re-run and watch the plugin logs for the first WebSocket connect attempt (the invalid field is typically shown before the close).
What I need to pinpoint this
• The exact google.realtime.RealtimeModel(...) kwargs you’re passing (paste the snippet).
• Which Gemini model string you used.
• Whether you’re authenticating via API key or Vertex AI (and whether GOOGLE_API_KEY or GOOGLE_APPLICATION_CREDENTIALS is set in the container).
Share those three items and I’ll give the precise corrected snippet and any container/env changes.
Sources: Gemini Live API plugin | LiveKit Documentation, with interactive elementsboundless-author-7811
04/14/2026, 1:37 PMllm=google.realtime.RealtimeModel(
model="gemini-2.5-flash-native-audio-preview-12-2025", # choose appropriate Gemini model
voice="Puck", # pick a supported Gemini voice
modalities=["AUDIO", "TEXT"], # Gemini uses these modality names
# turn_detection=None, # disable server-side turn detection if desired
# Gemini does not support OpenAI's `input_audio_noise_reduction` parameter
api_key="key", # or use Vertex AI credentials instead
#vertexai=False, # set True and provide project/location if using Vertex AI
),tall-airline-16756
04/14/2026, 1:37 PMapi_key="key" but didn’t show the environment/auth wiring; Gemini expects a valid API key or Vertex credentials.
• WebSocket 1007 usually means an invalid argument was sent to Gemini. Common causes are unsupported model options or mismatched modality/field names.
Corrected minimal snippet (use this pattern)
llm = google.realtime.RealtimeModel(
model="gemini-2.5-flash-native-audio-preview-12-2025",
voice="Puck",
modalities=["AUDIO", "TEXT"],
api_key=deployment.api_key, # use a real key from env/secret
vertexai=False, # set True + project/location if using Vertex
)
Actionable checks to fix 1007
• Ensure the model string is compatible (avoid Gemini 3.1 variants).
• Remove any unsupported kwargs (e.g., input_audio_noise_reduction, enable_affective_dialog, proactivity, or other non-Gemini fields).
• Confirm auth:
◦ If using API key mode: set api_key and export it as GOOGLE_API_KEY inside the container.
◦ If using Vertex AI: set vertexai=True, provide project and location, and mount service account JSON as GOOGLE_APPLICATION_CREDENTIALS.
• Verify modalities values match expected casing ("AUDIO","TEXT").
• Inspect the plugin logs for the first connect attempt — the invalid field is often logged just before the close.
Quick ask so I can give an exact fix
1. Are you using API key mode or Vertex AI?
2. Paste the full kwargs you pass into google.realtime.RealtimeModel(...) (redact secrets).
Send those and I’ll return the exact corrected snippet + the env/compose or k8s changes you need.
, with interactive elements