Gemini 3 for Developers

By Google for Developers

Share:

Key Concepts

  • Gemini 3 Pro preview: The latest and most intelligent model from Google AI, excelling in science, math, multimodal reasoning, agentic, and coding tasks.
  • Google AI Studio: A playground environment for testing new models and features.
  • Gemini API: An interface for developers to integrate Gemini models into their applications.
  • Python SDK: A software development kit for Python developers to interact with the Gemini API.
  • API Key: A unique identifier required to authenticate requests to the Gemini API.
  • Billing Setup: Necessary for using Gemini 3 via the API.
  • Colab Secrets: A feature in Google Colaboratory to securely store API keys.
  • Environment Variable: An alternative method to store API keys outside of code.
  • pip install google-generativeai: The command to install the Google GenAI SDK.
  • generate_content: The primary method in the SDK for sending prompts to the model.
  • thinking_config: A parameter to control the model's reasoning depth (high or low).
  • Multimodal Reasoning: The ability of the model to process and understand information from different modalities (e.g., images, video, text).
  • Files API: An API for uploading and managing files for use with Gemini models.
  • media_resolution: A parameter to control the resolution of media inputs (e.g., high, low) to manage token usage.
  • Built-in Tools: Pre-integrated functionalities like Google Search and Code Execution that Gemini can leverage.
  • Concise Flesch-Kincaid Grade Level: A readability test that estimates the U.S. school grade level required to understand a text.

Gemini 3 Pro: Introduction and Capabilities

Gemini 3 is presented as Google's most intelligent model to date, demonstrating significant improvements in science and math. It boasts high performance in multimodal reasoning, agentic tasks, and coding. The model is now accessible to developers, with the presenter eager to showcase how to begin building and creating with it.

Getting Started with Gemini 3 Pro in Google AI Studio

The initial demonstration focuses on using Gemini 3 Pro preview within Google AI Studio, a playground environment.

  1. Accessing AI Studio: The presenter navigates to Google AI Studio.
  2. Prompting for Data Analysis: A prompt is entered: "Analyze the sales data from my fruit stand. Return the results to me as a nicely formatted HTML."
  3. Enabling Code Execution and Data Upload: Code execution is turned on, and sample sales data from a tropical fruit stand (including transaction details, sales amounts, and revenue) is uploaded.
  4. Model Selection: It's crucial to select "Gemini 3 Pro preview" from the model selector. The presenter notes that at launch, this specific preview version will be visible, while later, it might simply be "Gemini 3 Pro."
  5. Reviewing Generated Output: The model processes the request, and the output is presented as a well-formatted HTML file. This HTML includes information on sales, revenue, trends over time, and top-performing items, showcasing Gemini's data analysis and formatting capabilities.

Integrating Gemini 3 Pro via the Gemini API (Python SDK)

The next section details how developers can integrate Gemini 3 Pro into their applications using the Gemini API and the Python SDK.

  1. API Key Generation:

    • Navigate to "Create API key."
    • Create a new API key, giving it a descriptive name (e.g., "Nikita test key 3").
    • Select or create a project.
    • Billing Setup: A critical step for API usage. If billing is not already set up for the project, a prompt to "set up billing" will appear, guiding the user through the process.
  2. Setting Up the Development Environment (Google Colaboratory Example):

    • Using Colab Secrets: In Colab, the API key can be securely stored by going to the "Secrets" tab, naming the secret "Gemini API key," and pasting the generated API key value.
    • Extracting the API Key: The user_data module is used to extract the API key from Colab secrets and set it as Gemini API key.
    • Importing and Initializing the SDK: The google.generativeai SDK is imported, and the client is set up using the API key.
    • Alternative for Non-Colab Environments: For environments other than Colab, the API key can be set as an environment variable. Crucially, hardcoding the API key directly into the client is strongly discouraged as it's a security risk.
    • SDK Installation: Colaboratory comes with the Google GenAI SDK pre-installed. For other environments, pip install google-generativeai is required.
  3. Testing Prompts with the Python SDK:

    • Example Prompt: A prompt is defined: "Classify the following five items into either fruit or vegetable and format your answer as a simple comma-separated list of pairs."
    • Sending the Request: The client.models.generate_content method is used, passing the model name (Gemini 3 Pro preview) and the prompt content.
    • Introducing thinking_config: A new parameter, thinking_config, is introduced. It accepts high or low values for the thinking_level.
      • low: Suitable for straightforward prompts where minimal reasoning is required.
      • high: Recommended for complex use cases (like the AI Studio example) to increase the depth of reasoning and the number of thinking tokens used.
    • Viewing the Response: The model's text response is accessed via response.text.
    • Example Output: The model correctly classifies items, even identifying zucchini as a fruit, which the presenter notes as a learning moment.

Gemini 3 Pro's Multimodal Reasoning Capabilities

This section demonstrates Gemini 3 Pro's ability to process and correlate information from different media types.

  1. Input Data: Files are uploaded to the Files API, including:

    • An image of the presenter as a child singing.
    • A home video clip (nearly an hour long) containing footage from the same day, starting with a brother's karate tournament.
  2. Prompting for Cross-Modal Search: The prompt asks Gemini to locate the scene from the image within the provided video.

  3. Optimizing Media Input:

    • media_resolution Parameter: The presenter highlights the use of media_resolution to manage token usage.
      • Image data is passed with media_resolution='high'.
      • Video data is passed with media_resolution='low' to conserve tokens, as video data is typically much larger and more expensive.
  4. Model Response: The model identifies the specific timestamp in the video where the singing scene occurs: "The image in the video appears at the 3503 mark."

  5. Verification: The presenter plays a short segment of the video around the 3503 mark, confirming the model's accurate identification of the singing scene.

Leveraging Built-in Tools with Gemini 3 Pro

Gemini 3 Pro can interact with external tools, such as Google Search and Code Execution, to perform more complex tasks.

  1. Google Search for Aesthetic Color Palette:

    • Prompt: "Generate a color palette for the hex codes for the aesthetic dark academia, which is a trending popular style right now, and then return the output as Python code that we can run."
    • Tool Integration: The model is given access to Google Search.
    • Process: Gemini uses Google Search to identify common colors and hex codes associated with the "dark academia" aesthetic. It then generates Python code to represent this palette.
    • Output: The model returns Python code. This code is then copied into a new Colab cell and executed, displaying a visually appealing dark academia color palette.
  2. Combining Tools for Complex Calculations:

    • Prompt: "Calculate the Flesch-Kincaid grade level of Edgar Allan Poe's story 'A Telltale Heart'."
    • Tool Combination: This prompt utilizes both the Code Execution tool and the Google Search tool.
    • Process:
      • Gemini uses Google Search to find and extract the text of "A Telltale Heart."
      • It then writes and executes Python code to perform the Flesch-Kincaid grade level calculation based on the extracted text (analyzing word count, syllable count, and sentence length).
    • thinking_level='high' Recommendation: This complex task is cited as an example where setting thinking_level to high is beneficial.
    • Response: The model returns an approximate grade level of 5.1. The presenter notes that the full response includes details of the executed code and Google Search results, providing transparency.

Conclusion and Next Steps

The presentation concludes by summarizing how developers can get started building and creating with Gemini 3 Pro. For further inspiration and learning:

  • AI Studio: Explore the AI Studio and its app gallery.
  • Documentation: Refer to the official documentation for more in-depth information on features.

The presenter expresses excitement about what developers will build and encourages them to share their creations.

Chat with this Video

AI-Powered

Load the transcript when you're ready to chat so the initial page stays lighter.

Ready to summarize another video?

Summarize YouTube Video