Google Gemini API lets developers change instructions mid-chat
Google says its Gemini Interactions API can now change system instructions and tool lists in the middle of a chat. The feature is in preview. Developers can add new rules or adjust tools while an AI agent is running, without reprocessing the full chat history or paying extra for old context.
The update adds a system_input field. Later requests can use the previous interaction ID and place system_input before user_input to add rules without stopping the session. Google suggests keeping the top-level system_instruction unchanged to keep prompt cache. If old and new rules clash, the model follows the newest one.
Tool changes use added_tools and removed_tools. Keeping the top-level tools list unchanged helps avoid cache misses. In one request, the API removes tools first, then adds new ones, so developers can swap function tools. The feature only supports function tools for now, not MCP server tools.
Comments
Loading comments…