
Gemini API Adds Mid-Conversation System Instructions and Tool Updates
Google said developers can now update system instructions or tools mid-conversation in the Gemini API preview through the Interactions API, while keeping the prompt cache intact and earlier turns cached.
Google has introduced mid-conversation system instruction and tool changes in preview in the Gemini API through the Interactions API. The feature lets agents adapt to new rules and tools during a session without re-reading the entire conversation or increasing costs. Developers can send a system_input step at any turn while keeping earlier turns cached.
How it works
To send an instruction mid-conversation, developers pass the previous turn's ID in previous_interaction_id and place a system_input step directly before user_input in the input array. The top-level system_instruction should stay unchanged across turns so the prompt prefix remains valid in the cache. Each system_input appends to conversation history as its own step and stays active for the rest of the session alongside the top-level instruction. Rules covering different topics remain in effect together, and when a newer system_input conflicts with an earlier instruction, the model favors the most recent instruction.
Tool updates
Tool declarations sit at the start of the prompt, so changing the top-level tools list between turns breaks the prompt cache. With system_input, developers are advised to keep the same top-level tools list on every turn and use added_tools and removed_tools to update which functions the model can call. Only updating function tools this way is currently supported, not MCP server tools. When a single step includes both fields, the API processes removed_tools before added_tools, which can replace a tool definition in place. Tool updates stay in effect until a later system_input changes them.
Use cases and pricing
Google lists uses such as applying rules discovered partway through a conversation, reinforcing key formatting or policy rules deep into multi-turn sessions, enabling or removing tools after authentication or plan approval, disabling a tool when a dependency goes offline, and starting with a small tool set before adding more. Mid-conversation system instructions carry no separate fee; tokens in system_input steps are billed at standard input token rates, and earlier turns remain eligible for cached-token rates when rules or tools change. The feature is available in public preview across all Gemini 4 models in the Interactions API through the v1beta endpoint.
Sources: blog.google
SiTech — AI-powered web development
We build fast, modern websites and bring AI into real business workflows. Have a project or a question? We'd love to help.