{"id":24277,"date":"2026-12-03T19:18:12","date_gmt":"2026-12-03T19:18:12","guid":{"rendered":"https:\/\/scannn.com\/mid-conversation-system-instructions-in-the-gemini-api-2\/"},"modified":"2026-12-03T19:18:12","modified_gmt":"2026-12-03T19:18:12","slug":"mid-conversation-system-instructions-in-the-gemini-api-2","status":"publish","type":"post","link":"https:\/\/scannn.com\/lv\/mid-conversation-system-instructions-in-the-gemini-api-2\/","title":{"rendered":"Mid-conversation system instructions in the Gemini API"},"content":{"rendered":"<p> <br \/>\n<\/p>\n<div>\n<p data-block-key=\"qyd80\">Tool updates stay in effect until a later <code>system_input<\/code> changes them. When a single step includes both fields, the API processes <code>removed_tools<\/code> before <code>added_tools<\/code>, letting you replace a tool definition in place. Adding a short text note when removing a tool also gives the model context to explain why an action is unavailable.<\/p>\n<p data-block-key=\"4edp7\">Keep in mind that <code>system_input<\/code>, <code>added_tools<\/code>, and <code>removed_tools<\/code> steer model behavior and serve as orchestration controls. Your application should still authorize every function call on the backend before executing it and keep untrusted external or end-user content out of <code>system_input<\/code>.<\/p>\n<h2 data-block-key=\"1ub5q\">How you can use it<\/h2>\n<p data-block-key=\"86bhm\"><b>Session-dependent constraints:<\/b> Apply rules discovered partway through a conversation, such as workspace settings, account entitlements, or spending limits.<\/p>\n<p data-block-key=\"229bk\"><b>Long-horizon instruction reinforcement:<\/b> Re-emphasize key formatting, tone, or policy rules deep into multi-turn sessions as context grows.<\/p>\n<p data-block-key=\"esh3r\"><b>Dynamic permissions and mode switches:<\/b> Enable write or account-action tools after authentication or plan approval, and remove them when returning to read-only review.<\/p>\n<p data-block-key=\"bbubu\"><b>Live operational changes:<\/b> Disable a tool and update guidance mid-session when a downstream dependency goes offline, then restore it once service recovers.<\/p>\n<p data-block-key=\"8u9nu\"><b>Large tool catalogs<\/b>: Start with a small set of tools and add more as the task needs them, without declaring every tool up front or breaking the cache.<\/p>\n<h2 data-block-key=\"4dvdf\">How pricing and supported models work<\/h2>\n<p data-block-key=\"59dvm\">Mid-conversation system instructions carry no separate fee. Tokens in system_input steps are billed at the standard input token rates for the model you call. Earlier turns remain eligible for cached-token rates when rules or tools change.<\/p>\n<p data-block-key=\"dhgne\">Mid-conversation system instructions are available in public preview across all Gemini 4 models in the Interactions API (through v1beta endpoint), in the Gemini API. Support for Gemini Enterprise Agent Platform to come soon.<\/p>\n<p data-block-key=\"d85bv\">Get started today by reading the documentation, comparing Gemini models to find the right Gemini 4 model for your workload, and join the discussion on the AI Developer Forum.<\/p>\n<\/div>\n<p><br \/>\n<br \/><a href=\"https:\/\/blog.google\/innovation-and-ai\/technology\/developers-tools\/gemini-api-mid-conversation-updates\/\">Source link <\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Tool updates stay in effect until a later system_input changes them. When a single step includes both fields, the API processes removed_tools before added_tools, letting you replace a tool definition in place. Adding a short text note when removing a tool also gives the model context to explain why an action is unavailable. Keep in [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":24276,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[100],"tags":[],"class_list":["post-24277","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-google"],"_links":{"self":[{"href":"https:\/\/scannn.com\/lv\/wp-json\/wp\/v2\/posts\/24277","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/scannn.com\/lv\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/scannn.com\/lv\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/scannn.com\/lv\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/scannn.com\/lv\/wp-json\/wp\/v2\/comments?post=24277"}],"version-history":[{"count":0,"href":"https:\/\/scannn.com\/lv\/wp-json\/wp\/v2\/posts\/24277\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/scannn.com\/lv\/wp-json\/wp\/v2\/media\/24276"}],"wp:attachment":[{"href":"https:\/\/scannn.com\/lv\/wp-json\/wp\/v2\/media?parent=24277"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/scannn.com\/lv\/wp-json\/wp\/v2\/categories?post=24277"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/scannn.com\/lv\/wp-json\/wp\/v2\/tags?post=24277"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}