Skip to content

Add storybook onboarding guide#1168

Draft
Giom-V wants to merge 1 commit intogoogle-gemini:mainfrom
Giom-V:storybook-onboarding
Draft

Add storybook onboarding guide#1168
Giom-V wants to merge 1 commit intogoogle-gemini:mainfrom
Giom-V:storybook-onboarding

Conversation

@Giom-V
Copy link
Copy Markdown
Collaborator

@Giom-V Giom-V commented Mar 23, 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 Mar 23, 2026
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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 Jupyter Notebook that functions as an interactive onboarding guide for the Gemini API. It provides a practical, step-by-step approach to understanding and utilizing various Gemini API capabilities by developing a children's storybook generator. The guide covers essential concepts from basic text generation to advanced multimodal outputs and structured data handling, offering a hands-on learning experience.

Highlights

  • New Onboarding Guide: Introduced a Jupyter Notebook (onboarding_storybuilder.ipynb) designed as a comprehensive onboarding guide for the Gemini API.
  • Children's Storybook Generator: The guide walks users through building a children's storybook generator, serving as a continuous project to learn Gemini API basics.
  • Key Gemini API Features Demonstrated: Covers basic prompting, error handling with retries, structured outputs using Pydantic, search grounding for factual validation, and multimodal generation (Imagen for images, Veo for videos, and audio generation).
  • Community Contribution: The notebook was contributed by Giom-V, showcasing community involvement in providing practical examples.
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.

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 introduces a new onboarding guide notebook for the Gemini API, focusing on building a children's storybook generator. The notebook effectively demonstrates basic prompting, error handling with retries, structured outputs using Pydantic, search grounding, and multimodal generation with Imagen and Veo. The overall structure and progression of the guide are well-conceived and didactic. However, there are several opportunities to improve adherence to the repository's style guide, particularly concerning notebook outputs, import placement, and code formatting for multi-line strings and function arguments.

Comment on lines +91 to +93
"source": [
"%pip install -U -q \"google-genai>=1.0.0\" pydantic tenacity"
]
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 code cells in this notebook do not have their outputs saved. The style guide specifies that outputs should ideally be saved in the notebooks so that readers can understand the code's functionality without needing to execute it themselves. Please run the notebook and save the outputs.

References
  1. Ideally we want the ouputs to be saved in the notebooks so that one can see what the code does without runnning it. (link)

Comment on lines +110 to +113
"import os\n",
"from google.colab import userdata\n",
"from google import genai\n",
"from google.genai import types\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.

medium

The style guide recommends placing imports when they are first used, rather than grouping them all in a single cell at the beginning of the notebook. This approach enhances readability by showing dependencies closer to their usage.

References
  1. Put the imports when they are first used. Try to avoid having a big "import" cell at the beginning. (link)

"metadata": {},
"outputs": [],
"source": [
"MODEL_ID = \"gemini-2.5-flash\" # @param [\"gemini-2.5-flash-lite\", \"gemini-2.5-flash\", \"gemini-2.5-pro\"] {\"allow-input\":true, isTemplate: true}"
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 MODEL_ID selector list is missing some of the latest models mentioned in the style guide's example. Expanding this list to include gemini-3.1-flash-lite-preview and gemini-3.1-pro-preview would provide users with more current options.

MODEL_ID = "gemini-2.5-flash" # @param ["gemini-2.5-flash-lite", "gemini-2.5-flash", "gemini-2.5-pro", "gemini-3.1-flash-lite-preview", "gemini-3-flash-preview", "gemini-3.1-pro-preview"] {"allow-input":true, isTemplate: true}
References
  1. When selecting a model, use a colab selector for easier maintainability: MODEL_ID="gemini-2.5-flash" # @param ["gemini-2.5-flash-lite", "gemini-2.5-flash", "gemini-2.5-pro", "gemini-3.1-flash-lite-preview", "gemini-3-flash-preview", "gemini-3.1-pro-preview"] {"allow-input":true, isTemplate: true} (link)

Comment on lines +260 to +265
"story_prompt = f\"\"\"\n",
" Create a 3-chapter story outline about this character:\n",
" {character_data['name']}, the {character_data['species']}.\n",
" Persona: {character_data['persona']}\n",
" \n",
" Chapter 3 should involve a trip to Paris during the Olympic Games.\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.

medium

The indentation for triple-quoted strings does not fully adhere to the style guide. For improved readability, the closing triple quotes should be on a new, unindented line.

story_prompt = f"""
    Create a 3-chapter story outline about this character:
    {character_data['name']}, the {character_data['species']}.
    Persona: {character_data['persona']}
    
    Chapter 3 should involve a trip to Paris during the Olympic Games.
"""
References
  1. Long text variables should use triple double quotes and proper indentation for better readability: Notice the line break on the first and last lines. (link)

Comment on lines +222 to +226
" config=types.GenerateContentConfig(\n",
" response_mime_type=\"application/json\",\n",
" response_schema=Character,\n",
" temperature=0.7\n",
" )\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.

medium

The indentation for multi-parameter function calls, specifically for the config dictionary, does not fully align with the style guide. The closing parenthesis of the function call should be on a new, unindented line for better readability.

    config=types.GenerateContentConfig(
        response_mime_type="application/json",
        response_schema=Character,
        temperature=0.7
    )
References
  1. When a function has multiple parameters, expend it on multiple lines with proper indentation for better readability: Notice the line break on the first and last lines. (link)

@Giom-V Giom-V marked this pull request as draft March 26, 2026 09:56
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 review PR awaiting review from a maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant