ProductsSelected

Google Adds Mid-Conversation System Instructions to Gemini Interactions API

谷歌更新 Gemini Interactions API:会话中动态更新指令,兼顾提示缓存有效性

Why we picked it

This changes how long-running agent loops are engineered: behaviour can now be retuned mid-session at cache-preserving cost, which previously forced a trade-off between instruction priority and latency. Builders of multi-turn agents in Python or the REST API should adopt the system_input pattern and audit runs through client.interactions.get. The limitation to function tools, with MCP server tool support still absent, matters for teams building MCP-based toolchains.

Google announced on 4 Dec 2025 a preview feature in its Gemini Interactions API that lets developers modify system instructions and tool lists mid-conversation, without reprocessing the full conversation history or incurring extra context-processing costs.

Body

The update introduces a new system_input field. Developers pass in the previous interaction's ID via previous_interaction_id and place system_input before user_input in the input array, appending instructions without interrupting the session. Google recommends keeping the top-level system_instruction unchanged and putting dynamic rules into separate system_input steps so the prompt-prefix cache stays valid. New instructions are appended as independent steps and take effect together with the original top-level instruction; on conflicts, the most recent instruction wins. Tool changes use added_tools and removed_tools fields rather than editing the top-level tools list, which would also break prompt caching. Removal is processed before addition within the same step, allowing tool definitions to be swapped in one request.

Previously, long-running agents had to either send new rules as user messages, which lacked priority and could be imitated by users, or rewrite system instructions and tool lists wholesale, invalidating the cache and raising cost and latency. The feature currently supports only function tools, not MCP server tools, and developers can inspect full interaction records via client.interactions.get.

Original · IT之家

谷歌更新 Gemini Interactions API:会话中动态更新指令,兼顾提示缓存有效性

IT之家 12 月 4 日消息,谷歌宣布已在 Gemini Interactions API 中推出会话中途修改系统指令和工具列表的功能,目前暂处于预览阶段。 开发者可以在智能体运行过程中的任意一轮添加新的系统指令,或动态调整模型可调用的工具,无需重新处理此前的完整对话历史,也不会因此产生额外的历史上下文处理成本。 在此次更新之前,长时间运行的 AI 智能体如果需要调整行为规则,通常有两种方式:一是将新指令作为用户消息发送,二是直接重写系统指令或替换工具列表。第一种方式存在指令优先级不足的问题,用户也可能通过模仿相关指令影响智能体行为;第二种方式则可能导致提示缓存失效,模型需要重新处理整段对话历史,从而增加调用成本和响应延迟。 此次更新引入了新的 system_input 字段。开发者可以在后续请求中传入上一轮交互的 ID,即 previous_interaction_id ,并在输入数组中将 system_input 放在 user_input 之前,以便在不中断现有会话的情况下追加系统指令。 谷歌建议开发者保持顶层 system_instruction 不变,将需要动态调整的规则放入独立的 system_input 步骤中。这样可以保留提示词前缀的缓存有效性,避免因修改顶层系统指令而重新处理历史内容。 新加入的 system_input 会作为独立步骤追加到对话历史,并与原有顶层系统指令共同生效。不同轮次添加的规则可以同时发挥作用;如果新旧指令之间存在冲突,模型会优先遵循最新加入的指令。 此外,开发者可以通过 client.interactions.get 获取完整交互记录。返回结果会按照执行顺序排列各个步骤,便于检查系统指令的变化以及多轮智能体的调用过程。 工具列表的动态调整则采用另一套机制。由于工具声明位于提示词前部,如果每轮请求都直接修改顶层 tools 列表,同样可能破坏提示缓存。因此,谷歌建议保持顶层工具列表不变,改用新增的 added_tools 和 removed_tools 字段,分别添加或移除模型可以调用的函数工具。 目前,这项能力仅支持函数工具的动态更新,尚不支持 MCP 服务器工具。如果同一个步骤中同时提供 removed_tools 和 added_tools ,API 会先处理移除操作,再处理添加操作,从而允许开发者在同一轮请求中替换现有工具定义。 相关阅读: 《 谷歌更新 Gemini 隐私控制,可保留聊天记录且不参与 AI 训练 》 《 谷歌推出 Gemini Decisions API 快速多模态决策,基于 Gemini Decision 1 模型 》 《 谷歌 Gemini 上线记忆摘要,可查看 / 编辑 / 删除 AI 记住的个人信息 》

Industry Coordinates & Source Verification

This report is categorized under AITOP's "Products" desk, focusing on US frontier AI labs and Silicon Valley technology leaders. Within our cross-regional analytical framework, it directly maps to AI developer toolchains, coding agents, and engineering workflows. Key entities and technical topics under continuous tracking include Gemini, Interactions API, MCP and tools, prompt caching.

Source attribution: curated from IT之家.

Spotted an error in the summary or translation? Tell us