AI / Google Antigravity Gemini Fundamentals Interview Questions
What is the observable execution steps feature in the Gemini Interactions API?
When using the Interactions API, each interaction object exposes execution steps - a detailed log of everything the model did to arrive at its answer, including thinking steps, tool calls, code execution, and web searches. This provides transparency into model reasoning for debugging and building rich UIs.
from google import genai client = genai.Client() interaction = client.interactions.create( model="gemini-3.5-flash", input="What is the square root of the number of stars in the Milky Way?", tools=[{"google_search": {}}], ) # Inspect every step the model took: for i, step in enumerate(interaction.steps): print(f"Step {i}: type={step.type}") if step.type == "thought": # Encrypted thinking (content not shown but signature confirms it happened) print(f" Thinking... (signature: {step.signature[:20]}...)") elif step.type == "tool_call": print(f" Tool call: {step.tool_call.name}") print(f" Arguments: {step.tool_call.arguments}") elif step.type == "tool_result": print(f" Tool result received") elif step.type == "code_execution": print(f" Code: {step.code}") print(f" Output: {step.output}") elif step.type == "model_output": print(f" Final answer: {step.content[0].text}") # Use steps to build a UI showing real-time reasoning: for step in interaction.steps: if step.type == "tool_call": show_ui("Searching the web for: " + step.tool_call.arguments.get("query","")) elif step.type == "thought": show_ui("Thinking...") elif step.type == "model_output": show_ui("Answer: " + step.content[0].text)
More Related questions...