Skip to main content
Continue an Antigravity interaction across turns. Each response carries an interaction_id; the next turn references it via previous_interaction_id so the API only receives the new user message. The server keeps the sandbox state (files written, packages installed, browser history) attached to the interaction chain - subsequent turns build on what the agent already did.
antigravity_multi_turn.py

Run the Example

1

Set up your virtual environment

2

Install dependencies

3

Export your Google API key

4

Run the example

Save the code above as antigravity_multi_turn.py, then run:
Full source: cookbook/90_models/google/gemini_interactions/antigravity_multi_turn.py