This message was deleted.
# ask-ai
s
This message was deleted.
t
Thanks for reaching out, Parth. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — I see the error about Gemini Realtime returning a 1008 policy violation for the model string
models/gemini-2.5-flash-preview-native-audio-dialog
. I’ll help you troubleshoot. What to check and next steps: • Use a supported model ID (no
models/
prefix). For example:
gemini-2.5-flash-native-audio-preview-09-2025
. • Ensure your plugin call passes only the model ID (not API version or path). • Confirm your Google/Vertex credentials or
GOOGLE_API_KEY
are set correctly. • Verify your Google project has access to preview/experimental native-audio models (those often require approval). • Make sure you’re using a LiveKit Google plugin version that supports the target Gemini model (
livekit-agents[google]
compatibility). Can you share: 1) the exact model string you’re sending in code (redact keys), and 2) which plugin version and authentication method you’re using? With that I can suggest the precise code change or config fix. Sources: Gemini Live API plugin | LiveKit docs
a
api key and plugin version is livekit-plugins-google~=1.3.3
t
Thanks — you’ve confirmed plugin
livekit-plugins-google~=1.3.3
and an API key. That’s fine. The error is coming from an invalid/unsupported model identifier. Please confirm two things so I can give the exact fix: 1. The exact model string you are sending in code (redact the API key). Is it prefixed with
models/
or an API version? 2. Are you initializing the Realtime model with
google.realtime.RealtimeModel
(code snippet if possible)? If you’re using a wrong model string, switch to:
gemini-2.5-flash-native-audio-preview-09-2025
If you share the model string and the short snippet where you set
model=...
, I’ll provide the exact code change. Sources: Gemini Live API plugin | LiveKit docs
Thanks — I reviewed your
create_instance
code. The key issue is the default model string and its format. What to change • Replace the default model: ◦ Current default:
"gemini-live-2.5-flash-preview"
◦ Use this supported Realtime model instead:
"gemini-2.5-flash-native-audio-preview-09-2025"
• Ensure you pass only the model ID (no
models/
prefix, no API version). Minimal code change
Copy code
if "model" not in filtered_config:
    filtered_config["model"] = "gemini-2.5-flash-native-audio-preview-09-2025"
Other checks (your code mostly covers these) • Keep
voice
only when
Modality.AUDIO
is present (your removal/default logic is correct). • Ensure
GOOGLE_API_KEY
or
api_key
is set (you said you use API key). • Confirm the Google project has access to the native-audio preview model and billing is enabled. If you update the default model and still get 1008, paste the exact
model
value that ends up in
filtered_config
(I’ll point out any remaining format/access issues). Would you like a suggested unit-test/snippet to validate the final config before creating the model?
Yes —
gemini-2.5-flash-native-audio-preview-09-2025
supports the TEXT modality. You can set it by passing
modalities=[Modality.TEXT]
(or
["TEXT"]
) when creating the
google.realtime.RealtimeModel
. If you use TEXT-only, keep
voice
out of the config (your code already removes it for TEXT-only), and use a separate TTS provider if you need synthesized audio output. Sources: Gemini Live API plugin | LiveKit docs
You're seeing the 1007 error because the model received a request that included a
voice
parameter while the request was TEXT-only. The Gemini Realtime model rejects voice settings on non-audio frames: "Cannot extract voices from a non-audio request." What to do • Confirm the final config passed into
google.realtime.RealtimeModel
does not include
"voice"
when modalities are TEXT-only. • Add a quick runtime check/log right before creating the model to show modalities and whether
voice
is present. Suggested quick check (add somewhere before
return google.realtime.RealtimeModel(**filtered_config)
):
Copy code
logger.info(f"Final Google Realtime config: modalities={filtered_config.get('modalities')}, voice_present={'voice' in filtered_config}")
If you see
modalities
contains only
Modality.TEXT
(or
"TEXT"
) but
voice_present
is True, your earlier removal logic isn't being applied — ensure the modality conversion and TTS-flag logic run before you set/remove
voice
. If the config looks correct (no
voice
with TEXT-only) but you still get 1007, paste the exact logged output for
filtered_config
(with
api_key
removed) and I’ll point out the remaining mismatch.