aloof-bear-48148
12/20/2025, 4:29 AMtall-airline-16756
12/20/2025, 4:29 AMtall-airline-16756
12/20/2025, 4:30 AMfunction_call parameter.
5. Whether you see any differences in message ordering or role names between the OpenAI case (works) and Gemini case (fails).
Quick troubleshooting steps you can try now (these often reveal what’s malformed):
• Verify role/order strictly: ensure the immediate previous message before the function call is a user message or a function response message (no assistant non-function messages, no system messages between them). Gemini enforces this ordering.
• Strip any extra metadata from assistant messages (e.g., thought signatures, custom fields). Try sending only {role, content} entries to see if the model accepts the function call.
• Compare the exact JSON sequence you send to OpenAI vs Google for the same interaction. Look for differences in role naming (assistant vs tool), extra assistant messages, or duplicate assistant turns.
• If you include a function response message, ensure it is labeled with role function and includes content exactly where the next call is expected.
• Temporarily disable any plugin-specific wrappers that mutate the chat history (one at a time) to isolate whether the plugin formatting causes the issue.
What I’ll do once you provide logs/snippets:
• Reproduce locally against Gemini 3 Flash with the same request format you’re using.
• Check whether the plugin adds assistant-thought metadata or transforms roles that could break Gemini’s strict turn-order rule.
• Suggest a minimal patch or workaround (strip/translate roles, reorder messages, or adjust function_call parameter) you can test immediately.
If you can paste the minimal log + request payload next, I’ll start reproducing and give a concrete fix.aloof-bear-48148
12/20/2025, 4:38 AMtall-airline-16756
12/20/2025, 4:38 AMrole == "system".
b. Use that filtered context when calling Gemini so the assistant/function/user turn ordering remains intact.
• Store those notifications outside the LLM chat history.
◦ Put tool/state notifications in session or agent metadata, or publish them via LiveKit data messages (participant.publish_data()), instead of inserting them as system messages in the chat stream.
• If you need the agent to be aware of the state, pass a short sanitized summary as a user or assistant message only at safe points (e.g., after a user turn), not between a function call and the next function call.
If you want, paste a minimal snippet of how you currently append system messages to the chat context and I’ll show the exact place to apply the filter and a one-line patch you can drop in.
Sources: Data packets | LiveKit docs | Web and mobile frontends | LiveKit docs | Google Gemini LLM plugin guide | LiveKit docsaloof-bear-48148
12/20/2025, 4:59 AMtall-airline-16756
12/20/2025, 4:59 AMrole == "system" messages before sending context to Gemini 2.5 Live.
• If you need those notifications, keep them in session/agent metadata or publish via LiveKit data messages instead of inserting them into the chat history.
• Test quickly by running one session with system messages included and one with them filtered to see if behavior differs.
If you want, share a minimal example of your 2.5 request payload and I’ll point out exactly where to filter.
Sources: Gemini Live API plugin | LiveKit docs