rhythmic-printer-24192
11/13/2025, 11:44 AMtall-airline-16756
11/13/2025, 11:44 AMtall-airline-16756
11/13/2025, 11:45 AMto_chat_ctx function to see how your conversation history is formatted before it goes to Gemini. It’s important that tool response turns are correctly converted to the "user" role, as Gemini expects.
2. Double-Check the Turn Order: Make sure every function call is coming right after a user message or a function response. If you have back-to-back function calls without a user or tool response in between, that’s likely causing the issue.
3. Review the Last Turn: The last turn in your conversation should be a user message. The system usually adds a dummy user message (just a single period) if needed, but if you want to troubleshoot, you can temporarily disable this by setting inject_dummy_user_message=False.
4. Confirm Function Response Formatting: Make sure your tool responses are properly formatted with the role "tool" and include the call ID and function name. This helps Gemini understand the flow.
5. Try a Simple Test: Create a minimal example with a user message followed by a function call to verify the basic flow is working correctly.
If you’re using the standard LiveKit integration with the google.LLM class, it should handle these details automatically. But if you hit any bumps or have more questions, please don’t hesitate to reach out—I’m here to support you every step of the way!
Sources: Google Gemini LLM plugin guide | LiveKit docs | livekit-plugins/livekit-plugins-google/README.md