Skip to content

Split and add Notebooks to Gemini Robotics#1138

Open
xpfgg wants to merge 2 commits into
google-gemini:mainfrom
xpfgg:main
Open

Split and add Notebooks to Gemini Robotics#1138
xpfgg wants to merge 2 commits into
google-gemini:mainfrom
xpfgg:main

Conversation

@xpfgg
Copy link
Copy Markdown
Contributor

@xpfgg xpfgg commented Feb 12, 2026

No description provided.

@review-notebook-app
Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@github-actions github-actions Bot added status:awaiting review PR awaiting review from a maintainer component:quickstarts Issues/PR referencing quickstarts folder labels Feb 12, 2026
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @xpfgg, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request refactors the existing Gemini Robotics content by moving it into a dedicated subdirectory and expanding it with new, detailed notebooks. The primary goal is to provide a more structured and comprehensive learning path for users interested in applying Gemini API features to robotics, focusing on determinism, latency control, and precise action.

Highlights

  • Notebook Restructuring: The Gemini Robotics-ER 1.5 notebook has been moved into a dedicated gemini_robotics subdirectory for better organization.
  • New Robotics Documentation: A new README.md file was added within the gemini_robotics directory, providing an overview and recommended order for the new robotics-focused notebooks.
  • New API Features Notebook: A new Jupyter notebook, robotics_api_features.ipynb, was introduced to demonstrate key Gemini API features essential for robotics, such as JSON mode, thinking budgets, and code execution.
Changelog
  • README.md
    • Updated the link for the Gemini Robotics-ER 1.5 notebook to reflect its new location.
  • quickstarts/gemini_robotics/README.md
    • Added a new README file to introduce the Gemini for Robotics notebook series and outline the recommended learning path.
  • quickstarts/gemini_robotics/robotics_api_features.ipynb
    • Added a new Jupyter notebook demonstrating how to use Gemini API features like JSON mode, thinking budgets, and code execution for robust robotics applications.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request effectively splits the robotics notebook into a more organized structure with a dedicated directory and README. The new robotics_api_features.ipynb notebook is a good addition. My review focuses on several areas for improvement in the new files to align with the repository's style guide and best practices. Specifically, I've pointed out a critical issue with an external dependency on a personal repository, and several medium-severity issues related to missing Colab badges, hardcoded model IDs, and inconsistent language use ('we' vs. 'you') as per the style guide. Addressing these will improve the quality, maintainability, and security of the new content.

"from PIL import Image\n",
"\n",
"if not os.path.exists('robotics_utils.py'):\n",
" url = \"https://raw.githubusercontent.com/williamito/robotics-samples/refs/heads/main/robotics_utils.py\"\n",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

This notebook downloads a utility script from a personal GitHub repository (williamito/robotics-samples). For security and maintainability, official cookbook examples must not depend on personal or unofficial repositories. Please vendor the robotics_utils.py script into this repository or another official Google-owned repository and update the URL.


## Notebooks

We recommend going through the notebooks in the following order:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

According to the repository style guide (line 91), documentation should use the second person ('you') instead of 'we'. Please rephrase this sentence to avoid using 'we'. For example: 'The notebooks should be reviewed in the following order:'.

References
  1. Use second person: "you" rather than "we". You will fail the lint check otherwise. (link)

Comment on lines +12 to +20
{
"cell_type": "markdown",
"metadata": {
"id": "CZC64QGBZ2v9"
},
"source": [
"# Engineering Reliability (API Features)"
]
},
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

According to the repository style guide (line 50), an 'Open in Colab' badge should be included in a new markdown cell immediately after the H1 title cell. This allows users to easily open the notebook in Colab.

The URL for the badge should be https://colab.research.google.com/github/google-gemini/cookbook/blob/main/quickstarts/gemini_robotics/robotics_api_features.ipynb.

References
  1. Include the "open in colab" button immediately after the H1. It should look like <a target=\"_blank\" href=\"URL\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" height=30/> where URL should be https://colab.research.google.com/github/google-gemini/cookbook/blob/main/ followed by the notebook location in the cookbook. (link)

},
"outputs": [],
"source": [
"%pip install -U -q google-genai google-colab"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The style guide (line 25) specifies that the google-genai package should be installed with a minimum version to ensure compatibility and prevent issues with older versions.

Suggested change
"%pip install -U -q google-genai google-colab"
"%pip install -U -q 'google-genai>=1.0.0' google-colab"
References
  1. %pip install -U -q 'google-genai>=1.0.0' is the right way to install the SDK. The version indicated should reflect the minimum version needed to use the features used in the notebook (1.0.0 by default or in doubt). (link)

"\n",
"GOOGLE_API_KEY = userdata.get(\"GOOGLE_API_KEY\")\n",
"client = genai.Client(api_key=GOOGLE_API_KEY)\n",
"MODEL_ID = \"gemini-3-flash-preview\""
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The style guide (line 72) recommends using a Colab form element for model selection to improve maintainability and allow users to easily experiment. Since this notebook has specific model requirements for the 'Thinking' feature, using a simple input field is appropriate.

MODEL_ID = "gemini-3-flash-preview"  # @param {type:"string"}
References
  1. When selecting a model, use a colab selector for easier maintainability. (link)

},
"source": [
"### Example: Eliminating Filler Text\n",
"By enforcing JSON mode, we create a strict contract between the AI and our robot controller, ensuring the output is always machine-readable."
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The style guide (line 91) recommends using the second person ('you') instead of 'we' to maintain a consistent voice across all documentation.

        "By enforcing JSON mode, you create a strict contract between the AI and your robot controller, ensuring the output is always machine-readable."
References
  1. Use second person: "you" rather than "we". You will fail the lint check otherwise. (link)

@kkorpal kkorpal self-assigned this Apr 21, 2026
@kkorpal
Copy link
Copy Markdown
Collaborator

kkorpal commented Apr 21, 2026

Hi @xpfgg, thank you for this extensive contribution!
While doing a first-pass review, I noticed a few things that need to be addressed before we can proceed:
Missing Colab Badges: I see you are adding 6 new files to the quickstarts directory, but none of the notebooks currently have the required "Open in Colab" badge under the main H1 title. Please add these to all notebooks (updating the URL to point to your branch).
Failing CI Checks: The automated notebook format and linting checks are currently failing. Please check the action logs, run the formatting tools locally, and push the fixes so all checks pass.

Could you please resolve these formatting issues? In the meantime, since this PR introduces multiple new files and creates a new subdirectory, I will discuss these structural changes with the core team and get back to you shortly!

@kkorpal kkorpal added the status:awaiting response Awaiting a response from the author label Apr 21, 2026
@review-notebook-app
Copy link
Copy Markdown

review-notebook-app Bot commented Apr 29, 2026

View / edit / reply to this conversation on ReviewNB

Giom-V commented on 2026-04-29T08:49:44Z
----------------------------------------------------------------

Line #1.    %pip install -U -q google-genai google-colab

I don't think you need google-colab. Can you also add a minimum version for google-genai as I don't think the oldest ones support all the features you're using.


@review-notebook-app
Copy link
Copy Markdown

review-notebook-app Bot commented Apr 29, 2026

View / edit / reply to this conversation on ReviewNB

Giom-V commented on 2026-04-29T08:49:45Z
----------------------------------------------------------------

Line #5.        url = "https://raw.githubusercontent.com/williamito/robotics-samples/refs/heads/rewrite/robotics_utils.py?token=GHSAT0AAAAAADS2JPNJS7O2QV5K5PIIT25Q2L37DKQ"

I think this should not live in a private repo. Can you move it to the cookbook too?

I also think you need to explain what those functions are doing, especially utils.query_gemini,utils.visualize_detections...


@review-notebook-app
Copy link
Copy Markdown

review-notebook-app Bot commented Apr 29, 2026

View / edit / reply to this conversation on ReviewNB

Giom-V commented on 2026-04-29T08:49:45Z
----------------------------------------------------------------

Line #2.    model_name = "gemini-3-flash-preview"

Model selector please, especially since you want the users to be able to easily switch to the ER model.

Also uniformize how the model id is named and use MODEL_ID as everywhere else in the cookbook.


@review-notebook-app
Copy link
Copy Markdown

review-notebook-app Bot commented Apr 29, 2026

View / edit / reply to this conversation on ReviewNB

Giom-V commented on 2026-04-29T08:49:46Z
----------------------------------------------------------------

Line #6.        thinking_config={"thinking_budget": 0} # Thinking off

Explain why the thinking is off


@@ -0,0 +1,303 @@
{
Copy link
Copy Markdown
Collaborator

@Giom-V Giom-V Apr 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line #7.    MODEL_ID = "gemini-3-flash-preview"

Can you add a modle selector (as everywhere else you are using gemini models)? (cf. styleguide.md or CONTRIBUTING.md)


Reply via ReviewNB

@@ -0,0 +1,303 @@
{
Copy link
Copy Markdown
Collaborator

@Giom-V Giom-V Apr 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This title looks weird. Is it part 1 or 2?


Reply via ReviewNB

@@ -0,0 +1,303 @@
{
Copy link
Copy Markdown
Collaborator

@Giom-V Giom-V Apr 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line #1.    img_sensor = Image.open("air_quality.jpeg")

Can you display the image?


Reply via ReviewNB

@@ -0,0 +1,303 @@
{
Copy link
Copy Markdown
Collaborator

@Giom-V Giom-V Apr 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe point to other interesting notebook, like the gemeini get started one, the robotics get started one as well. Yoàu should not assume that users will read your four notebooks in the right order and that they could start with any one and then be interested in the other.


Reply via ReviewNB

@review-notebook-app
Copy link
Copy Markdown

review-notebook-app Bot commented Apr 29, 2026

View / edit / reply to this conversation on ReviewNB

Giom-V commented on 2026-04-29T08:49:50Z
----------------------------------------------------------------

Output is missing, please rerun


@review-notebook-app
Copy link
Copy Markdown

review-notebook-app Bot commented Apr 29, 2026

View / edit / reply to this conversation on ReviewNB

Giom-V commented on 2026-04-29T08:49:51Z
----------------------------------------------------------------

Add output


@review-notebook-app
Copy link
Copy Markdown

review-notebook-app Bot commented Apr 29, 2026

View / edit / reply to this conversation on ReviewNB

Giom-V commented on 2026-04-29T08:49:51Z
----------------------------------------------------------------

Add a link to the other 2 spatial understanding notebooks already in the cookbook (and vice-versa). And also wayme it would be worth explaining what this one has that the others don't.


@@ -0,0 +1,529 @@
{
Copy link
Copy Markdown
Collaborator

@Giom-V Giom-V Apr 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line #8.    print(response.text)

Might be worth formating the Markdown?


Reply via ReviewNB

@@ -0,0 +1,529 @@
{
Copy link
Copy Markdown
Collaborator

@Giom-V Giom-V Apr 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line #6.    Comparing the start of the episode (first 4 images) with the current state (last 4 images),

Please indent the multi-line string.


Reply via ReviewNB

@@ -0,0 +1,529 @@
{
Copy link
Copy Markdown
Collaborator

@Giom-V Giom-V Apr 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line #35.        You have functions: move(x, y, high), setGripper(opened).

PLease indent.


Reply via ReviewNB

@@ -0,0 +1,529 @@
{
Copy link
Copy Markdown
Collaborator

@Giom-V Giom-V Apr 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add more links if possible (at the very least to the main get started with robotics notbook)


Reply via ReviewNB

@Giom-V
Copy link
Copy Markdown
Collaborator

Giom-V commented Apr 29, 2026

@xpfgg did a first pass of review. I did'nt comment everything but most of the comment apply to multiple places in the notebooks. Please also check the issues reported by gemini as they are also relevant and the same as mine sometimes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component:quickstarts Issues/PR referencing quickstarts folder status:awaiting response Awaiting a response from the author status:awaiting review PR awaiting review from a maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants