Added example for gemini api used to extract insights from github #923 #887#1150
Added example for gemini api used to extract insights from github #923 #887#1150ROHANDWIVEDI2005 wants to merge 6 commits intogoogle-gemini:mainfrom
Conversation
ROHANDWIVEDI2005
commented
Mar 5, 2026
- This is an update from Added example for GitHub_issues_analyzer #923
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Summary of ChangesHello, 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 introduces a new example notebook that showcases the integration of the Gemini API with GitHub. The notebook is designed to analyze GitHub issues and extract valuable insights, providing a practical demonstration of how the Gemini API can be applied to real-world data from development platforms. Highlights
Changelog
Activity
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 aims to add a new example notebook for analyzing GitHub issues. However, the submitted notebook, GitHub_issue_analyzer.ipynb, is an unmodified template and lacks the actual implementation. It needs to be filled out with the example code and content. There are also several issues with the template content itself, such as an incorrect Colab link and an invalid model parameter, which I've commented on. Additionally, the update to examples/README.md breaks the table formatting.
| { | ||
| "cells": [ | ||
| { | ||
| "cell_type": "markdown", | ||
| "metadata": { | ||
| "id": "Tce3stUlHN0L" | ||
| }, | ||
| "source": [ | ||
| "##### Copyright 2026 Google LLC." | ||
| ] | ||
| }, | ||
| { | ||
| "cell_type": "code", | ||
| "execution_count": null, | ||
| "metadata": { | ||
| "cellView": "form", | ||
| "id": "tuOe1ymfHZPu" | ||
| }, | ||
| "outputs": [], | ||
| "source": [ | ||
| "#@title Licensed under the Apache License, Version 2.0 (the \"License\");\n", | ||
| "# you may not use this file except in compliance with the License.\n", | ||
| "# You may obtain a copy of the License at\n", | ||
| "#\n", | ||
| "# https://www.apache.org/licenses/LICENSE-2.0\n", | ||
| "#\n", | ||
| "# Unless required by applicable law or agreed to in writing, software\n", | ||
| "# distributed under the License is distributed on an \"AS IS\" BASIS,\n", | ||
| "# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n", | ||
| "# See the License for the specific language governing permissions and\n", | ||
| "# limitations under the License." | ||
| ] | ||
| }, | ||
| { | ||
| "cell_type": "markdown", | ||
| "metadata": { | ||
| "id": "qFdPvlXBOdUN" | ||
| }, | ||
| "source": [ | ||
| "# Gemini API: Name of your guide" | ||
| ] | ||
| }, | ||
| { | ||
| "cell_type": "markdown", | ||
| "metadata": { | ||
| "id": "MfBg1C5NB3X0" | ||
| }, | ||
| "source": [ | ||
| "<a target=\"_blank\" href=\"https://colab.research.google.com/github/google-gemini/cookbook/blob/main/quickstarts/Template.ipynb\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" height=30/></a>" | ||
| ] | ||
| }, | ||
| { | ||
| "cell_type": "markdown", | ||
| "metadata": { | ||
| "id": "r6P32iYYV27b" | ||
| }, | ||
| "source": [ | ||
| "_[remove me] Be sure to update the Colab link!_" | ||
| ] | ||
| }, | ||
| { | ||
| "cell_type": "markdown", | ||
| "metadata": { | ||
| "id": "XCVydW40iixa" | ||
| }, | ||
| "source": [ | ||
| "[If you're adding a new example, use this badge to promote yourself (yes sorry you'll have to write your name a lot of times)]\n", | ||
| "<!-- Community Contributor Badge -->\n", | ||
| "<table>\n", | ||
| " <tr>\n", | ||
| " <!-- Author Avatar Cell -->\n", | ||
| " <td bgcolor=\"#d7e6ff\">\n", | ||
| " <a href=\"https://github.com/Giom-V\" target=\"_blank\" title=\"View Guillaume's profile on GitHub\">\n", | ||
| " <img src=\"https://github.com/Giom-V.png?size=100\"\n", | ||
| " alt=\"Giom-V's GitHub avatar\"\n", | ||
| " width=\"100\"\n", | ||
| " height=\"100\">\n", | ||
| " </a>\n", | ||
| " </td>\n", | ||
| " <!-- Text Content Cell -->\n", | ||
| " <td bgcolor=\"#d7e6ff\">\n", | ||
| " <h2><font color='black'>This notebook was contributed by <a href=\"https://github.com/Giom-V\" target=\"_blank\"><font color='#217bfe'><strong>Giom (use either your GitHub handle or your real name, your choice)</strong></font></a>.</font></h2>\n", | ||
| " <h5><font color='black'><a href=\"URL\"><font color=\"#078efb\">Add a link to you blog, or linkedIn, or something else</font></a> - See <a href=\"https://github.com/Giom-V\" target=\"_blank\"><font color=\"#078efb\"><strong>Giom</strong></font></a> other notebooks <a href=\"https://github.com/search?q=repo%3Agoogle-gemini%2Fcookbook%20%22Giom%22&type=code\" target=\"_blank\"><font color=\"#078efb\">here</font></a>.</h5></font><br>\n", | ||
| " <!-- Footer -->\n", | ||
| " <font color='black'><small><em>Have a cool Gemini example? Feel free to <a href=\"https://github.com/google-gemini/cookbook/blob/main/CONTRIBUTING.md\" target=\"_blank\"><font color=\"#078efb\">share it too</font></a>!</em></small></font>\n", | ||
| " </td>\n", | ||
| " </tr>\n", | ||
| "</table>" | ||
| ] | ||
| }, | ||
| { | ||
| "cell_type": "markdown", | ||
| "metadata": { | ||
| "id": "6b527162" | ||
| }, | ||
| "source": [ | ||
| "[When the model is a preview one an can potentially change or if it's a paid-only feature, add a disclaimer:]\n", | ||
| "> **Note:** Image generation is a paid-only feature and won't work if you are on the free tier. Check the [pricing](https://ai.google.dev/pricing#imagen-4) page for more details.\n", | ||
| "\n", | ||
| "> **Note:** Image-out is a preview feature. It is free to use for now with quota limitations, but is subject to change.\n" | ||
| ] | ||
| }, | ||
| { | ||
| "cell_type": "markdown", | ||
| "metadata": { | ||
| "id": "xHxb-dlhMIzW" | ||
| }, | ||
| "source": [ | ||
| "[Include a paragraph or two here explaining what this example demonstrates, who should be interested in it, and what you need to know before you get started.]" | ||
| ] | ||
| }, | ||
| { | ||
| "cell_type": "markdown", | ||
| "metadata": { | ||
| "id": "monLpKy7423V" | ||
| }, | ||
| "source": [ | ||
| "## Setup" | ||
| ] | ||
| }, | ||
| { | ||
| "cell_type": "markdown", | ||
| "metadata": { | ||
| "id": "5mi7BrkD44MF" | ||
| }, | ||
| "source": [ | ||
| "### Install SDK" | ||
| ] | ||
| }, | ||
| { | ||
| "cell_type": "code", | ||
| "execution_count": null, | ||
| "metadata": { | ||
| "id": "AQJjzmYgH3sX" | ||
| }, | ||
| "outputs": [], | ||
| "source": [ | ||
| "%pip install -U -q \"google-genai>=1.0.0\" # Install the Python SDK\n", | ||
| "\n", | ||
| "# Always set at least 1.0.0 as the minimal version as there were breaking\n", | ||
| "# changes through the previous versions\n", | ||
| "# Of course, if your notebook uses a new feature and needs a more recent\n", | ||
| "# version, set the right minimum version to indicate when the feature was\n", | ||
| "# introduced.\n", | ||
| "# Always test your notebook with that fixed version (eg. '==1.0.0') to make.\n", | ||
| "# sure it's really the minimum version.\n" | ||
| ] | ||
| }, | ||
| { | ||
| "cell_type": "markdown", | ||
| "metadata": { | ||
| "id": "MUXex9ctTuDB" | ||
| }, | ||
| "source": [ | ||
| "### Set up your API key\n", | ||
| "\n", | ||
| "To run the following cell, your API key must be stored it in a Colab Secret named `GOOGLE_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see the [Authentication ](../quickstarts/Authentication.ipynb) quickstart for an example." | ||
| ] | ||
| }, | ||
| { | ||
| "cell_type": "code", | ||
| "execution_count": null, | ||
| "metadata": { | ||
| "id": "wltbMJLIIXGk" | ||
| }, | ||
| "outputs": [], | ||
| "source": [ | ||
| "from google.colab import userdata\n", | ||
| "from google import genai\n", | ||
| "\n", | ||
| "GOOGLE_API_KEY = userdata.get('GOOGLE_API_KEY')\n", | ||
| "client = genai.Client(api_key=GOOGLE_API_KEY)" | ||
| ] | ||
| }, | ||
| { | ||
| "cell_type": "markdown", | ||
| "metadata": { | ||
| "id": "hL54YG-kMDVF" | ||
| }, | ||
| "source": [ | ||
| "Now select the model you want to use in this guide, either by selecting one in the list or writing it down. Keep in mind that some models, like the 2.5 ones are thinking models and thus take slightly more time to respond (cf. [thinking notebook](./Get_started_thinking.ipynb) for more details and in particular learn how to switch the thiking off)." | ||
| ] | ||
| }, | ||
| { | ||
| "cell_type": "code", | ||
| "execution_count": null, | ||
| "metadata": { | ||
| "id": "Lf6FamchMDsk" | ||
| }, | ||
| "outputs": [], | ||
| "source": [ | ||
| "MODEL_ID = \"gemini-3-flash-preview\" # @param [\"gemini-2.5-flash-lite\", \"gemini-2.5-flash\", \"gemini-2.5-pro\", \"gemini-2.5-flash-preview\", \"gemini-3.1-flash-lite-preview\", \"gemini-3.1-pro-preview\"] {\"allow-input\":true, isTemplate: true}\n", | ||
| "\n", | ||
| "# Ideally order the model by \"cabability\" ie. generation then within generation\n", | ||
| "# 8b/flash-lite then flash then pro" | ||
| ] | ||
| }, | ||
| { | ||
| "cell_type": "markdown", | ||
| "metadata": { | ||
| "id": "w5i8tMZKIeUu" | ||
| }, | ||
| "source": [ | ||
| "## [Write your guide]\n", | ||
| "\n", | ||
| "[Add as many high level sections as needed to step through your guide. Try to introduce new concepts incrementally, including explanatory text at every step. Remember that notebooks need to be executable from start to finish using `Runtime -> Run all` in Colab.]" | ||
| ] | ||
| }, | ||
| { | ||
| "cell_type": "markdown", | ||
| "metadata": { | ||
| "id": "4677dd58e9b5" | ||
| }, | ||
| "source": [ | ||
| "## Next Steps\n", | ||
| "### Useful API references:\n", | ||
| "\n", | ||
| "[Always end with links to the related doumentation]\n", | ||
| "\n", | ||
| "### Related examples\n", | ||
| "\n", | ||
| "[If any, add links to the related examples]\n", | ||
| "\n", | ||
| "### Continue your discovery of the Gemini API\n", | ||
| "\n", | ||
| "[Finally, link some other quickstarts that are either related or require the same level of expertise]\n" | ||
| ] | ||
| }, | ||
| { | ||
| "cell_type": "markdown", | ||
| "metadata": { | ||
| "id": "UhNtHfuxCGVy" | ||
| }, | ||
| "source": [ | ||
| "# Resources (don't forget to delete everything starting from here)\n", | ||
| "\n", | ||
| "* Follow the [Google developer documentation style guide](https://developers.google.com/style/highlights)\n", | ||
| "* The [TensorFlow documentation style guide](https://www.tensorflow.org/community/contribute/docs_style) has useful guidance for notebooks.\n", | ||
| "* Read the [Cookbook contributor guide](https://github.com/google-gemini/cookbook/blob/main/CONTRIBUTING.md) and the [Cookbook Examples contributor guide](https://github.com/google-gemini/cookbook/blob/main/examples/CONTRIBUTING.md)." | ||
| ] | ||
| }, | ||
| { | ||
| "cell_type": "markdown", | ||
| "metadata": { | ||
| "id": "2V22fKegUtF9" | ||
| }, | ||
| "source": [ | ||
| "## Notebook style (also check the [Contributing guide](Contributing.mg))\n", | ||
| "\n", | ||
| "* Include the collapsed license at the top (uses the Colab \"Form\" mode to hide the cells).\n", | ||
| "* Save the notebook with the table of contents open.\n", | ||
| "* Use one `H1` header for the title.\n", | ||
| "* Include the button-bar immediately after the `H1`.\n", | ||
| "* Include an overview section before any code.\n", | ||
| "* Keep your installs and imports close to the code that first uses them. If they are used throughout (such as the SDK), they can go at the start of the guide.\n", | ||
| "* Keep code and text cells as brief as possible.\n", | ||
| "* Break text cells at headings\n", | ||
| "* Break code cells between \"building\" and \"running\", and between \"printing one result\" and \"printing another result\".\n", | ||
| "* Necessary but uninteresting code should be hidden in a toggleable code cell by putting `# @title` as the first line.\n", | ||
| "* You can optionally add a byline for content in `examples/` that you wrote, including one link to your GitHub, social, or site of your choice." | ||
| ] | ||
| }, | ||
| { | ||
| "cell_type": "markdown", | ||
| "metadata": { | ||
| "id": "QKp40qS-DGEZ" | ||
| }, | ||
| "source": [ | ||
| "### Code style\n", | ||
| "\n", | ||
| "* Notebooks are for people. Write code optimized for clarity.\n", | ||
| "* Keep examples quick and concise.\n", | ||
| "* Use the [Google Python Style Guide](http://google.github.io/styleguide/pyguide.html), where applicable. Code formatted by [`pyink`](https://github.com/google/pyink) will always be accepted.\n", | ||
| "* In particular, defining functions and variables takes extra spaces around the `=` sign, while function parameters don't:\n", | ||
| "```python\n", | ||
| " var = value\n", | ||
| " function(\n", | ||
| " parameter=value\n", | ||
| " )\n", | ||
| "```\n", | ||
| "* If you define a function, run it and show us what it does before using it in another function.\n", | ||
| "* Demonstrate small parts before combining them into something more complex.\n", | ||
| "* Keep the code as simple as possible, only use extra parameters like temperature when needed, and in that case, explain why\n", | ||
| "* To ensure notebook text remains accurate, present model metadata by executing code.\n", | ||
| " * For example, instead of saying \"1M token context\" in the text, display the output of `client.models.get(model='...').input_token_limit`.\n" | ||
| ] | ||
| }, | ||
| { | ||
| "cell_type": "markdown", | ||
| "metadata": { | ||
| "id": "78HBT9cQXJko" | ||
| }, | ||
| "source": [ | ||
| "### Text\n", | ||
| "\n", | ||
| "* Use an imperative style. \"Run a prompt using the API.\"\n", | ||
| "* Use sentence case in titles/headings.\n", | ||
| "* Use short titles/headings: \"Download the data\", \"Call the API\", \"Process the results\".\n", | ||
| "* Use the [Google developer documentation style guide](https://developers.google.com/style/highlights).\n", | ||
| "* Use [second person](https://developers.google.com/style/person): \"you\" rather than \"we\".\n", | ||
| "* When using links between notebooks, use relative ones as they'll work better in IDEs and Colab. Use absolute ones to link to folders or markdown files.\n" | ||
| ] | ||
| }, | ||
| { | ||
| "cell_type": "markdown", | ||
| "metadata": { | ||
| "id": "YrsKXcPRUvK9" | ||
| }, | ||
| "source": [ | ||
| "## GitHub workflow\n", | ||
| "\n", | ||
| "* Be consistent about how you save your notebooks, otherwise the JSON diffs are messy. [`nbfmt` and `nblint`](https://github.com/tensorflow/docs/blob/master/tools/tensorflow_docs/tools/README.md) help here.\n", | ||
| "* This notebook has the \"Omit code cell output when saving this notebook\" option set. GitHub refuses to diff notebooks with large diffs (inline images).\n", | ||
| "* [ReviewNB.com](http://reviewnb.com) can help with diffs. This is linked in a comment on a notebook pull request.\n", | ||
| "* Use the [Open in Colab](https://chrome.google.com/webstore/detail/open-in-colab/iogfkhleblhcpcekbiedikdehleodpjo) extension to open a GitHub notebook in Colab.\n", | ||
| "* The easiest way to edit a notebook in GitHub is to open it with Colab from the branch you want to edit. Then use File --> Save a copy in GitHub, which will save it back to the branch you opened it from.\n", | ||
| "* For PRs it's helpful to post a direct Colab link to the PR head: https://colab.research.google.com/github/{USER}/{REPO}/blob/{BRANCH}/{PATH}.ipynb" | ||
| ] | ||
| } | ||
| ], | ||
| "metadata": { | ||
| "colab": { | ||
| "collapsed_sections": [ | ||
| "Tce3stUlHN0L" | ||
| ], | ||
| "name": "GitHub_issue_analyzer.ipynb", | ||
| "toc_visible": true | ||
| }, | ||
| "kernelspec": { | ||
| "display_name": "Python 3", | ||
| "name": "python3" | ||
| } | ||
| }, | ||
| "nbformat": 4, | ||
| "nbformat_minor": 0 | ||
| } |
There was a problem hiding this comment.
This notebook appears to be an unmodified copy of the project's template. The content for the 'GitHub issue analyzer' example is missing. Please replace all placeholder text and instructions with the actual code and explanations for your example. I've added more specific comments on issues within the template that also need to be addressed.
examples/GitHub_issue_analyzer.ipynb
Outdated
| "id": "MfBg1C5NB3X0" | ||
| }, | ||
| "source": [ | ||
| "<a target=\"_blank\" href=\"https://colab.research.google.com/github/google-gemini/cookbook/blob/main/quickstarts/Template.ipynb\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" height=30/></a>" |
There was a problem hiding this comment.
The 'Open in Colab' badge link points to the template notebook (.../quickstarts/Template.ipynb) instead of this new notebook. According to the repository style guide (lines 50-53), this should be updated to point to the correct location for this example (.../examples/GitHub_issue_analyzer.ipynb).
<a target="_blank" href="https://colab.research.google.com/github/google-gemini/cookbook/blob/main/examples/GitHub_issue_analyzer.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" height=30/></a>
References
- The 'Open in Colab' button should link to the notebook's location on GitHub, allowing users to open it directly in Colab. (link)
| }, | ||
| "outputs": [], | ||
| "source": [ | ||
| "MODEL_ID = \"gemini-3-flash-preview\" # @param [\"gemini-2.5-flash-lite\", \"gemini-2.5-flash\", \"gemini-2.5-pro\", \"gemini-2.5-flash-preview\", \"gemini-3.1-flash-lite-preview\", \"gemini-3.1-pro-preview\"] {\"allow-input\":true, isTemplate: true}\n", |
There was a problem hiding this comment.
The default MODEL_ID "gemini-3-flash-preview" is not included in the list of available models in the @param definition, which will cause an error in the Colab form. Please ensure the default value is present in the list of options, as per the style guide on model selection (line 72).
MODEL_ID = "gemini-3-flash-preview" # @param ["gemini-2.5-flash-lite", "gemini-2.5-flash", "gemini-2.5-pro", "gemini-3-flash-preview", "gemini-3.1-flash-lite-preview", "gemini-3.1-pro-preview"] {"allow-input":true, isTemplate: true}
References
- When using a Colab selector for models, the default model ID must be one of the options available in the dropdown list. (link)
examples/README.md
Outdated
| | [Talk to documents](./Talk_to_documents_with_embeddings.ipynb) | Use embeddings to search through a custom database. | Embeddings | [](https://colab.research.google.com/github/google-gemini/cookbook/blob/main/examples/Talk_to_documents_with_embeddings.ipynb) | | ||
| | [Entity extraction](./Entity_Extraction.ipynb) | Use Gemini API to speed up some of your tasks, such as searching through text to extract needed information. Entity extraction with a Gemini model is a simple query, and you can ask it to retrieve its answer in the form that you prefer. | Embeddings | [](https://colab.research.google.com/github/google-gemini/cookbook/blob/main/examples/Entity_Extraction.ipynb) | | ||
| | [Google I/O 2025 Live coding session](./Google_IO2025_Live_Coding.ipynb) | Play with the notebook used during the Google I/O 2025 live coding session delivered by the Google DeepMind DevRel team. Work with the Gemini API SDK, know and practice with the GenMedia models, the thinking capable models, start using the Gemini API tools and more! | Gemini API and its models and features | [](https://colab.research.google.com/github/google-gemini/cookbook/blob/main/examples/Google_IO2025_Live_Coding.ipynb) | | ||
| | [GitHub issue analyzer](./GitHub_issue_analyzer.ipynb) | Use Gemini API to interact with Pygithub API and extract useful insights from this repository | [](https://colab.research.google.com/github/google-gemini/cookbook/blob/main/examples/GitHub_issue_analyzer.ipynb) | |
There was a problem hiding this comment.
The new table row for 'GitHub issue analyzer' is missing the 'Features' column, which breaks the table's alignment. Please add the relevant features for your example to this column to fix the formatting.
| | [GitHub issue analyzer](./GitHub_issue_analyzer.ipynb) | Use Gemini API to interact with Pygithub API and extract useful insights from this repository | [](https://colab.research.google.com/github/google-gemini/cookbook/blob/main/examples/GitHub_issue_analyzer.ipynb) | | |
| | [GitHub issue analyzer](./GitHub_issue_analyzer.ipynb) | Use Gemini API to interact with Pygithub API and extract useful insights from this repository | Gemini API, Tools | [](https://colab.research.google.com/github/google-gemini/cookbook/blob/main/examples/GitHub_issue_analyzer.ipynb) | |
|
@gemini-code-assist review the notebook |
There was a problem hiding this comment.
Code Review
This pull request introduces a new example notebook demonstrating how to use the Gemini API with function calling to analyze GitHub issues. While the concept is valuable, the notebook has several critical issues that prevent it from running correctly. The primary issue is the use of an incorrect API for the chat session, which will cause a runtime error. Additionally, a pip install cell is broken, and many cells have not been executed, indicating the notebook has not been fully tested. There are also several violations of the repository's style guide concerning notebook formatting and markdown content. I've provided specific comments and suggestions to address these issues.
| "client = genai.Client(api_key=GOOGLE_API_KEY)\n", | ||
| "chat = client.chats.create(\n", | ||
| " model=MODEL_ID,\n", | ||
| " config={\n", | ||
| " \"tools\": [\n", | ||
| " get_github_issues,\n", | ||
| " get_issues_by_label,\n", | ||
| " get_stale_issues,\n", | ||
| " get_unassigned_issues,\n", | ||
| " get_issue_summary,\n", | ||
| " search_issues\n", | ||
| " ]\n", | ||
| " }\n", | ||
| ")\n", |
There was a problem hiding this comment.
This cell contains code that will not run as written. The client.chats.create() method returns a Chat object from the low-level API, which does not have a send_message method. This will cause a runtime error. The output provided for this cell appears to be from a different, working version of the code, which is misleading.
To fix this, you should use the high-level genai.GenerativeModel API to create the model and start a chat session. Also, the client is re-initialized here, which is redundant as it was already created in a previous cell.
model = genai.GenerativeModel(
model_name=MODEL_ID,
tools=[
get_github_issues,
get_issues_by_label,
get_stale_issues,
get_unassigned_issues,
get_issue_summary,
search_issues
]
)
chat = model.start_chat()
| "%pip install -U -q \"google-genai>=1.0.0\" # Install the Python SDK\n", | ||
| "\n", | ||
| "# Always set at least 1.0.0 as the minimal version as there were breaking\n", | ||
| "# changes through the previous versions\n", | ||
| "# Of course, if your notebook uses a new feature and needs a more recent\n", | ||
| "# version, set the right minimum version to indicate when the feature was\n", | ||
| "# introduced.\n", | ||
| "# Always test your notebook with that fixed version (eg. '==1.0.0') to make.\n", | ||
| "# sure it's really the minimum version.\n" | ||
| ] |
There was a problem hiding this comment.
This cell fails to execute, as shown by the error in the notebook's output. The lines of comments after the %pip install command are being interpreted as part of the command. Please move these comments to a separate markdown cell or remove them to fix the installation step.
%pip install -U -q "google-genai>=1.0.0" # Install the Python SDK
| }, | ||
| { | ||
| "cell_type": "code", | ||
| "execution_count": null, |
There was a problem hiding this comment.
This cell, along with many others in the notebook, has execution_count: null, indicating it hasn't been run. The repository style guide (line 40) notes that if code has changed but outputs haven't, it's a sign the notebook hasn't been tested. Please ensure you run all cells from top to bottom and save the notebook with outputs before merging to verify that it works correctly.
References
- The
outputsdo not have to be ignored, but if none of them changed while some code has, it might be a sign that the notebook has not been run to check that it works, in which case a warning should be raised; (link)
| "execution_count": 1, | ||
| "metadata": { |
There was a problem hiding this comment.
The execution_count for this cell is 1, and it's also non-null for several other cells. According to the repository style guide (line 43), this indicates that the notebook formatting script has not been run. Please run the formatting script to reset the execution counts to null before merging.
References
- If the
execution_counthas changed to something else thannull, it usually indicates that the formatting script has not been run. A warning should be raised, but only once per notebook. Be very clear that it means that the formatting script must be run, not that the outputs should be removed. (link)
| " <!-- Text Content Cell -->\n", | ||
| " <td bgcolor=\"#d7e6ff\">\n", | ||
| " <h2><font color='black'>This notebook was contributed by <a href=\"https://github.com/rohandwivedi2005\" target=\"_blank\"><font color='#217bfe'><strong>Rohan Dwivedi</strong></font></a>.</font></h2>\n", | ||
| " <h5><font color='black'><a href=\"www.linkedin.com/in/rohan-dwivedi-a67664296\"><font color=\"#078efb\">Find me at linked-in</font></a> - See <a href=\"https://github.com/rohandwivedi2005\" target=\"_blank\"><font color=\"#078efb\"><strong>Rohan</strong></font></a> other notebooks <a href=\"https://github.com/search?q=repo%3Agoogle-gemini%2Fcookbook%20%rohandwivedi2005%22&type=code\" target=\"_blank\"><font color=\"#078efb\">here</font></a>.</h5></font><br>\n", |
There was a problem hiding this comment.
There are a couple of issues in this markdown cell:
- The link to LinkedIn is broken because it's missing the
https://protocol. - The use of
<font>tags is deprecated in HTML5 and should be avoided. It's better to use standard markdown for styling.
<h5><font color='black'><a href="https://www.linkedin.com/in/rohan-dwivedi-a67664296"><font color="#078efb">Find me at linked-in</font></a> - See <a href="https://github.com/rohandwivedi2005" target="_blank"><font color="#078efb"><strong>Rohan</strong></font></a> other notebooks <a href="https://github.com/search?q=repo%3Agoogle-gemini%2Fcookbook%20%rohandwivedi2005%22&type=code" target="_blank"><font color="#078efb">here</font></a>.</h5></font><br>
examples/GitHub_issue_analyzer.ipynb
Outdated
| "- This notebook demonstrates how to use the Gemini API with function calling to interact with the GitHub API and extract and analyze information about issues in a repository.\n", | ||
| "- To achive this goal we will be using the `PyGithub` python library to extract information from github which will later be analyzed by the gemini to present the answers to the queries asked." |
There was a problem hiding this comment.
There are a few style and grammar issues in the introduction:
- There's a typo: "achive" should be "achieve".
- The style guide (line 91) recommends using the second person ("you") instead of "we".
- "github" and "gemini" should be capitalized as "GitHub" and "Gemini" for consistency.
- This notebook demonstrates how to use the Gemini API with function calling to interact with the GitHub API and extract and analyze information about issues in a repository.
- To achieve this goal, you will be using the `PyGithub` python library to extract information from GitHub which will later be analyzed by Gemini to present the answers to your queries.
References
- Use second person: "you" rather than "we". You will fail the lint check otherwise. (link)
examples/GitHub_issue_analyzer.ipynb
Outdated
| "id": "hL54YG-kMDVF" | ||
| }, | ||
| "source": [ | ||
| "Now select the model you want to use in this guide, either by selecting one in the list or writing it down. Keep in mind that some models, like the 2.5 ones are thinking models and thus take slightly more time to respond (cf. [thinking notebook](./Get_started_thinking.ipynb) for more details and in particular learn how to switch the thiking off)." |
There was a problem hiding this comment.
There's a typo in this sentence. "thiking" should be "thinking".
Now select the model you want to use in this guide, either by selecting one in the list or writing it down. Keep in mind that some models, like the 2.5 ones are thinking models and thus take slightly more time to respond (cf. [thinking notebook](./Get_started_thinking.ipynb) for more details and in particular learn how to switch the thinking off).
examples/GitHub_issue_analyzer.ipynb
Outdated
| "source": [ | ||
| "You will need a GitHub Personal Access Token stored as a Colab Secret named **GITHUB_API_KEY**.\n", | ||
| "\n", | ||
| "1. Navigate to your GitHub account settings, select `Devloper settings`\n", |
examples/README.md
Outdated
| | [Entity extraction](./Entity_Extraction.ipynb) | Use Gemini API to speed up some of your tasks, such as searching through text to extract needed information. Entity extraction with a Gemini model is a simple query, and you can ask it to retrieve its answer in the form that you prefer. | Embeddings | [](https://colab.research.google.com/github/google-gemini/cookbook/blob/main/examples/Entity_Extraction.ipynb) | | ||
| | [Google I/O 2025 Live coding session](./Google_IO2025_Live_Coding.ipynb) | Play with the notebook used during the Google I/O 2025 live coding session delivered by the Google DeepMind DevRel team. Work with the Gemini API SDK, know and practice with the GenMedia models, the thinking capable models, start using the Gemini API tools and more! | Gemini API and its models and features | [](https://colab.research.google.com/github/google-gemini/cookbook/blob/main/examples/Google_IO2025_Live_Coding.ipynb) | | ||
|
|
||
| | [GitHub issue analyzer](./GitHub_issue_analyzer.ipynb) | Use Gemini API to interact with Pygithub API and extract useful insights from this repository | Gemini API, Tools | [](https://colab.research.google.com/github/google-gemini/cookbook/blob/main/examples/GitHub_issue_analyzer.ipynb) | |
There was a problem hiding this comment.
The description for the new notebook could be more precise. Also, "Pygithub" should be capitalized as "PyGitHub" for consistency.
| | [GitHub issue analyzer](./GitHub_issue_analyzer.ipynb) | Use Gemini API to interact with Pygithub API and extract useful insights from this repository | Gemini API, Tools | [](https://colab.research.google.com/github/google-gemini/cookbook/blob/main/examples/GitHub_issue_analyzer.ipynb) | | |
| | [GitHub issue analyzer](./GitHub_issue_analyzer.ipynb) | Use the Gemini API with function calling to interact with the PyGitHub API and analyze issues in a repository. | Gemini API, Tools | [](https://colab.research.google.com/github/google-gemini/cookbook/blob/main/examples/GitHub_issue_analyzer.ipynb) | |
|
@Giom-V I made a few changes for lint check and a few gramatical errors but I can't seem to fix the issue with the colab button could you help me on this |
