AIFeed

Google Updates Gemini Interactions API: Dynamically Update Instructions Mid-Session While Preserving Prompt Cache Validity

AI summary

Google announced the preview launch of a feature in the Gemini Interactions API that lets developers modify system instructions and tool lists mid-conversation. Developers can add new system instructions or dynamically adjust the model's callable tools at any turn during an agent's run, without reprocessing the full prior conversation history or incurring extra context-processing costs. The update introduces a system_input field and added_tools/removed_tools fields, and currently supports only dynamic updates of function tools, not MCP server tools.

Translation(model translation, not the source's own text)

Google Updates Gemini Interactions API: Dynamically Update Instructions Mid-Conversation While Preserving Prompt Cache Validity

IT Home, December 4 news: Google has announced the launch of the ability to modify system instructions and tool lists mid-conversation in the Gemini Interactions API, currently in preview.

Developers can add new system instructions at any turn during an agent's run, or dynamically adjust the tools the model can call, without reprocessing the full prior conversation history, and without incurring additional historical context processing costs.

Before this update, long-running AI agents that needed to adjust behavior rules typically had two options: send the new instructions as a user message, or directly rewrite the system instructions or replace the tool list. The first approach suffers from insufficient instruction priority, and users could potentially influence agent behavior by mimicking the relevant instructions; the second approach could invalidate the prompt cache, requiring the model to reprocess the entire conversation history, thereby increasing call costs and response latency.

This update introduces a new system_input field. Developers can pass the ID of the previous interaction, namely previous_interaction_id, in subsequent requests, and place system_input before user_input in the input array, so as to append system instructions without interrupting the existing session.

Google recommends that developers keep the top-level system_instruction unchanged and place rules that need dynamic adjustment into separate system_input steps. This preserves the cache validity of the prompt prefix and avoids reprocessing historical content due to modifying the top-level system instructions.

Newly added system_input is appended to the conversation history as an independent step and takes effect together with the original top-level system instructions. Rules added in different turns can take effect simultaneously; if there is a conflict between old and new instructions, the model will prioritize the most recently added instructions.

In addition, developers can retrieve the complete interaction record via client.interactions.get. The returned result arranges each step in execution order, making it easy to inspect changes to system instructions and the call process of multi-turn agents.

Dynamic adjustment of the tool list uses a different mechanism. Since tool declarations are located at the front of the prompt, directly modifying the top-level tools list on every request could likewise break the prompt cache. Therefore, Google recommends keeping the top-level tool list unchanged and instead using the newly added added_tools and removed_tools fields to add or remove function tools the model can call, respectively.

Currently, this capability only supports dynamic updates of function tools and does not yet support MCP server tools. If removed_tools and added_tools are provided in the same step, the API will process the removal operation first and then the addition operation, allowing developers to replace existing tool definitions within the same request.

  • "Google Updates Gemini Privacy Controls, Allowing Chat History Retention Without AI Training"
  • "Google Launches Gemini Decisions API for Fast Multimodal Decision-Making, Based on the Gemini Decision 1 Model"
  • "Google Gemini Launches Memory Summaries, Allowing Users to View / Edit / Delete Personal Information Remembered by AI"

Related Articles

  • Google Search Engine Integrates Gemini 4 Neon, AI Mode Allows Manual Model Switching
  • Google's Strongest Medical AI Model: MedGemma 2 Debuts, Helping Doctors Diagnose by Filling Gaps
  • Hand-Drawn Sketches Instantly Become Playable Games: Google Launches AI Game Creation Tool Pillowfort, Breaking Down Programming Barriers
  • Google Antigravity Opens to Hong Kong and Macau, China, with Gemini 4 Model Access Tied to Subscription Plans
  • SemiAnalysis: Claude and Google AI Ultra's Top Subscription Tiers Each Worth Over $10,000, More Than Five Times That of ChatGPT
  • Report: Meta Close to Multi-Billion-Dollar Deal to Lease Google TPUs from Crux AI

The translation is machine-generated and individual terms may be off. Nothing is rewritten or cut; the original is authoritative.

Published by IT之家
This site only summarises and aggregates; copyright stays with the original author. Headlines and summaries follow the source — where they differ, the original wins.
Read the original ↗