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)
Invest now in Acorns!!! 🚀
Join Acorns and get your $5 bonus!
Acorns is a micro-investing app that automatically invests your "spare change" from daily purchases into diversified, expert-built portfolios of ETFs. It is designed for beginners, allowing you to start investing with as little as $5. The service automates saving and investing. Disclosure: I may receive a referral bonus.
Invest now!!! Get Free equity stock (US, UK only)!
Use Robinhood app to invest in stocks. It is safe and secure. Use the Referral link to claim your free stock when you sign up!.
The Robinhood app makes it easy to trade stocks, crypto and more.
Webull! Receive free stock by signing up using the link: Webull signup.
More Related questions...
