Skip to content

Gemini 3.1 Live — document update_instructions limitation + provide alternative pattern for dynamic prompts #5496

@webbliam124

Description

@webbliam124

Problem

Since livekit-plugins-google 1.5.3, calling session.update_instructions() on a session using gemini-3.1-flash-live-preview emits:

update_instructions is not compatible with 'gemini-3.1-flash-live-preview' and will be ignored.

Per PR #5332, this is an intentional guard around a server-side Gemini 3.1 restriction (send_client_content rejected with WS 1007 after the first model turn).

What's missing

Production use cases need to update an agent's behavior mid-call (escalation prompts, language switching, context-aware tool enable/disable). On Gemini 2.5 we used update_instructions for this. On 3.1 there is no documented alternative.

Request

  1. Document the limitation in the plugin README + RealtimeModel docstring.
  2. Provide a recommended pattern for dynamic prompts on 3.1:
    • End session + restart with updated instructions?
    • Inject context via tool result?
    • session.generate_reply(instructions=...) for per-turn instructions?
  3. Emit the warning once per session, not once per call — current verbosity pollutes production logs.

Reproduction

Any session on gemini-3.1-flash-live-preview calling await session.update_instructions("new") emits the warning; behavior is silently a no-op.

Environment

  • livekit-agents[google] 1.5.2-1.5.4
  • gemini-3.1-flash-live-preview
  • LiveKit Cloud (eu-central)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions