rhythmic-printer-24192
09/03/2025, 12:04 PMtall-airline-16756
09/03/2025, 12:04 PMtall-airline-16756
09/03/2025, 12:04 PMrhythmic-printer-24192
09/03/2025, 12:08 PMtall-airline-16756
09/03/2025, 12:08 PMrhythmic-printer-24192
09/03/2025, 12:08 PMtall-airline-16756
09/03/2025, 12:09 PMgemini-2.5-flash-lite?
• Which authentication method are you going with—API key or Vertex AI?
• Are there any extra parameters like thinking_config or automatic_function_calling_config that you’re including that might be triggering the invalid argument error?
• If you have it handy, could you share the exact error message or response body from the INVALID_ARGUMENT error? Sources: plugins/google/src/beta/gemini_tts.ts | Gemini Live API integration guide | LiveKit Docs | Gemini TTS integration guide | LiveKit Docs | livekit-plugins/livekit-plugins-aws/livekit/plugins/aws/experimental/realti...rhythmic-printer-24192
09/03/2025, 12:15 PMtall-airline-16756
09/03/2025, 12:16 PMmodel) has to come right after a user message (role user).
• A function call output (role user) should follow the function call to complete that interaction.
Here’s how you can fix this:
1. Make sure every function call is immediately after a user message or a function response.
2. Consider using tools like LiveKit’s ChatContext to help manage and format your chat messages automatically—this can save you a lot of headaches!
3. If you’re building messages by hand, double-check that the last message before sending is from the user.
For example, a good message flow looks like this:
user → model (function call) → user (function response) → model (assistant reply)
If you want, I’m happy to walk you through it or share some examples to get this working smoothly in your setup. Just let me know!
Sources: livekit-agents/livekit/agents/voice/agent_activity.py | plugins/google/src/llm.ts | Testing and evaluation | LiveKit Docs | LiveKit turn detector plugin | LiveKit Docs