gray-carpet-66596
09/08/2025, 3:49 PMgemini-live-2.5-flash-preview model (Live API).
Use cases I’m exploring:
• Update Instruction → to update user behavior profile or user memory in real time, so the agent can adapt based on interactions.
• Update Chat Context → to influence the LLM conversation state directly.
So far, I’ve experimented with different role values (user, assistant, system) and combinations of them, but I’m not fully clear on the best practice.
Here’s a simplified sample of what I’ve tried:
chat_ctx = self.chat_ctx.copy()
chat_ctx.add_message(
role="user",
content="I want to conclude the product exploration and proceed to add product to my cart."
)
chat_ctx.add_message(
role="assistant",
content="Adding product to the cart."
)
await self.update_chat_ctx(chat_ctx)
My queries:
• What’s the recommended way to update instructions for gemini live model (like memory/user behavior) during a live session?
• For chat context updates, is there a preferred role or pattern that works best with Live API?
• Any practical tips or patterns you’ve found that make these updates more reliable?
Thanks in advance! 🙏
cc - @refined-appointment-81829 @fast-dentist-39499