Skip to content

fix(examples): Use await in session_service call in Getting_started_with_ADK.ipynb - #1661

Open
janasangeetha wants to merge 3 commits into
google-gemini:mainfrom
janasangeetha:Getting_started_with_ADK-patch
Open

janasangeetha wants to merge 3 commits into
google-gemini:mainfrom
janasangeetha:Getting_started_with_ADK-patch

Conversation

@janasangeetha

@janasangeetha janasangeetha commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Getting_started_with_ADK.ipynb produces below errors on main:

  1. session = session_service.create_session -> ValueError: Session not found: session_01
  2. final_session = session_service.get_session -> AttributeError: 'coroutine' object has no attribute 'state'

Changes made:

  1. Added the missing await keyword to session = session_service.create_session when initializing session, to ensure the session is properly created in session_service rather than returning an unexecuted coroutine object, preventing ValueError: Session not found
  2. Added the missing await keyword to final_session = session_service.get_session when retrieving final_session, to prevent final_session from being assigned an unexecuted coroutine object.

@review-notebook-app

Copy link
Copy Markdown

Review Notebooks

Notebooks changed:

Review visual diffs and comment on any notebook cell. All comments sync back to this PR.


Powered by ReviewNB

@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 updates the 'Getting_started_with_ADK.ipynb' notebook to ensure correct asynchronous handling of session service operations. It also includes maintenance updates to notebook cell execution counts, metadata, and output formatting to provide a more stable and accurate user experience.

Highlights

  • Asynchronous Method Updates: Updated session service calls to use 'await' for 'create_session' and 'get_session' methods to ensure proper asynchronous execution.
  • Notebook Metadata and Formatting: Updated execution counts for code cells and added comprehensive 'language_info' metadata to the notebook configuration.
  • Output Cleanup: Refined stderr output messages and formatted text strings to improve readability and consistency in the notebook outputs.
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 the 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 counterproductive. 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. ↩

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

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.

Code Review

This pull request updates the Getting_started_with_ADK.ipynb notebook, specifically adding await to the session_service calls (create_session and get_session), updating the execution counts, and adding language metadata. The review feedback correctly points out that the execution_count values were changed from null to integers, indicating that the repository's notebook formatting script needs to be run to clean up and standardize the notebook metadata before submission.

@janasangeetha janasangeetha changed the title Getting_started_with_ADK.ipynb fix(examples): Use await in session_service call in Getting_started_with_ADK.ipynb Dec 3, 2026
@janasangeetha
janasangeetha marked this pull request as ready for review December 3, 2026 17:43
@janasangeetha
janasangeetha requested a review from kkorpal December 3, 2026 17:43
@github-actions github-actions Bot added status:awaiting review PR awaiting review from a maintainer component:examples Issues/PR referencing examples folder labels Dec 3, 2026

@kkorpal kkorpal left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I ran the notebook's code with the current ADK (google-adk 2.16.0), with and without the change:

  • On main, the events cell fails with Session not found: session_01, and the last cell fails too.
  • With the two awaits it runs: the same five events as before, then Final workflow status: END and Agent response: Hello ADK!.

The fix is right. One thing before approving:

  1. The latest version removes the saved outputs of three cells (the key cell, the event log and the final status). Section 5 still tells readers to look at the event log "printed above", so those outputs are needed. Please keep the notebook as it is on main and change only the two lines. The old outputs still match what the fixed code prints, and this also clears the bot's execution_count comment.

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

Labels

component:examples Issues/PR referencing examples folder status:awaiting review PR awaiting review from a maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants