Split and add Notebooks to Gemini Robotics#1138
Split and add Notebooks to Gemini Robotics#1138xpfgg wants to merge 2 commits intogoogle-gemini:mainfrom
Conversation
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Summary of ChangesHello @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
Changelog
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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
- Use second person: "you" rather than "we". You will fail the lint check otherwise. (link)
| { | ||
| "cell_type": "markdown", | ||
| "metadata": { | ||
| "id": "CZC64QGBZ2v9" | ||
| }, | ||
| "source": [ | ||
| "# Engineering Reliability (API Features)" | ||
| ] | ||
| }, |
There was a problem hiding this comment.
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
- 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/>whereURLshould behttps://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" |
There was a problem hiding this comment.
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.
| "%pip install -U -q google-genai google-colab" | |
| "%pip install -U -q 'google-genai>=1.0.0' google-colab" |
References
%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\"" |
There was a problem hiding this comment.
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
- 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." |
There was a problem hiding this comment.
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
- Use second person: "you" rather than "we". You will fail the lint check otherwise. (link)
No description provided.