Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Add Banner about Gen AI SDK to Notebooks using Vertex AI SDK #1539

Merged
merged 1 commit into from
Dec 16, 2024

Conversation

holtskinner
Copy link
Collaborator

Fixes #1535 🦕

@holtskinner holtskinner requested a review from a team as a code owner December 16, 2024 16:50
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Copy link
Contributor

@code-review-assist code-review-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.

Hi @holtskinner and reviewers,

code-review-assist is currently reviewing this pull request and will provide a full review shortly. In the meantime, here's a quick summary to help everyone get up to speed:

This PR addresses issue #1535 by adding a banner to several Jupyter notebooks within the generative-ai repository. The banner informs users that these notebooks utilize the Vertex AI SDK, which currently lacks support for Gemini 2.0. It directs users to an alternative notebook using the Google Gen AI SDK for Gemini 2.0 compatibility. The affected notebooks are:

  • gemini/context-caching/intro_context_caching.ipynb (lines 31-38)
  • gemini/controlled-generation/intro_controlled_generation.ipynb (lines 31-38)
  • gemini/function-calling/intro_function_calling.ipynb (lines 31-38)
  • gemini/grounding/intro-grounding-gemini.ipynb (lines 31-38)
  • gemini/long-context/intro_long_context.ipynb (lines 31-38)
  • gemini/prompts/intro_prompt_design.ipynb (lines 31-38)
  • gemini/rag-engine/intro_rag_engine.ipynb (lines 31-38)
  • gemini/responsible-ai/gemini_prompt_attacks_mitigation_examples.ipynb (lines 31-38)
  • gemini/responsible-ai/gemini_safety_ratings.ipynb (lines 31-38)

The change is a simple addition of a Markdown note within each notebook's introductory section, providing clear and concise guidance to users. This ensures users aren't misled by outdated or incompatible examples.


And now, a little haiku to lighten the mood:

Code flows like a stream,
Clear banners guide the lost ones,
Smooth review, we hope.

@holtskinner holtskinner merged commit a6ce365 into main Dec 16, 2024
9 checks passed
@holtskinner holtskinner deleted the sdk-notice branch December 16, 2024 16:50
Copy link
Contributor

@code-review-assist code-review-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.

This pull request adds a helpful banner to several notebooks, clarifying that they use the Vertex AI SDK, which doesn't support Gemini 2.0. The banner consistently directs users to a relevant Gemini 2.0 example using the Gen AI SDK. This improves user experience by preventing confusion and guiding users to the correct resources. The PR title and description clearly explain the change and reference the related issue. Overall, the changes are well-done and ready for approval.

@@ -31,6 +31,8 @@
"source": [
"# Intro to Context Caching with the Gemini API\n",
"\n",
"> **NOTE:** This notebook uses the Vertex AI SDK, which does not support Gemini 2.0; refer to [Intro to Gemini 2.0 Flash](https://github.com/GoogleCloudPlatform/generative-ai/blob/sdk-updates/gemini/getting-started/intro_gemini_2_0_flash.ipynb) which uses the Google Gen AI SDK.\n",
Copy link
Contributor

Choose a reason for hiding this comment

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

low

Nit: Slightly rephrase for precision. Instead of "This notebook uses the Vertex AI SDK, which does not support Gemini 2.0", consider "This notebook uses the Vertex AI SDK for Gemini, which is not compatible with Gemini 2.0."

Suggested change
"> **NOTE:** This notebook uses the Vertex AI SDK, which does not support Gemini 2.0; refer to [Intro to Gemini 2.0 Flash](https://github.com/GoogleCloudPlatform/generative-ai/blob/sdk-updates/gemini/getting-started/intro_gemini_2_0_flash.ipynb) which uses the Google Gen AI SDK.\n",
> **NOTE:** This notebook uses the Vertex AI SDK for Gemini, which is not compatible with Gemini 2.0; refer to [Intro to Gemini 2.0 Flash](https://github.com/GoogleCloudPlatform/generative-ai/blob/sdk-updates/gemini/getting-started/intro_gemini_2_0_flash.ipynb) which uses the Google Gen AI SDK.

@@ -31,6 +31,8 @@
"source": [
"# Intro to Controlled Generation with the Gemini API\n",
"\n",
"> **NOTE:** This notebook uses the Vertex AI SDK, which does not support Gemini 2.0; refer to [Intro to Gemini 2.0 Flash](https://github.com/GoogleCloudPlatform/generative-ai/blob/sdk-updates/gemini/getting-started/intro_gemini_2_0_flash.ipynb) which uses the Google Gen AI SDK.\n",
Copy link
Contributor

Choose a reason for hiding this comment

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

low

Nit: Slightly rephrase for precision. Instead of "This notebook uses the Vertex AI SDK, which does not support Gemini 2.0", consider "This notebook uses the Vertex AI SDK for Gemini, which is not compatible with Gemini 2.0."

Suggested change
"> **NOTE:** This notebook uses the Vertex AI SDK, which does not support Gemini 2.0; refer to [Intro to Gemini 2.0 Flash](https://github.com/GoogleCloudPlatform/generative-ai/blob/sdk-updates/gemini/getting-started/intro_gemini_2_0_flash.ipynb) which uses the Google Gen AI SDK.\n",
> **NOTE:** This notebook uses the Vertex AI SDK for Gemini, which is not compatible with Gemini 2.0; refer to [Intro to Gemini 2.0 Flash](https://github.com/GoogleCloudPlatform/generative-ai/blob/sdk-updates/gemini/getting-started/intro_gemini_2_0_flash.ipynb) which uses the Google Gen AI SDK.

@@ -31,6 +31,8 @@
"source": [
"# Intro to Function Calling with the Gemini API & Python SDK\n",
"\n",
"> **NOTE:** This notebook uses the Vertex AI SDK, which does not support Gemini 2.0; refer to [Intro to Gemini 2.0 Flash](https://github.com/GoogleCloudPlatform/generative-ai/blob/sdk-updates/gemini/getting-started/intro_gemini_2_0_flash.ipynb) which uses the Google Gen AI SDK.\n",
Copy link
Contributor

Choose a reason for hiding this comment

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

low

Nit: Slightly rephrase for precision. Instead of "This notebook uses the Vertex AI SDK, which does not support Gemini 2.0", consider "This notebook uses the Vertex AI SDK for Gemini, which is not compatible with Gemini 2.0."

Suggested change
"> **NOTE:** This notebook uses the Vertex AI SDK, which does not support Gemini 2.0; refer to [Intro to Gemini 2.0 Flash](https://github.com/GoogleCloudPlatform/generative-ai/blob/sdk-updates/gemini/getting-started/intro_gemini_2_0_flash.ipynb) which uses the Google Gen AI SDK.\n",
> **NOTE:** This notebook uses the Vertex AI SDK for Gemini, which is not compatible with Gemini 2.0; refer to [Intro to Gemini 2.0 Flash](https://github.com/GoogleCloudPlatform/generative-ai/blob/sdk-updates/gemini/getting-started/intro_gemini_2_0_flash.ipynb) which uses the Google Gen AI SDK.

@@ -31,6 +31,8 @@
"source": [
"# Getting Started with Grounding with Gemini in Vertex AI\n",
"\n",
"> **NOTE:** This notebook uses the Vertex AI SDK, which does not support Gemini 2.0; refer to [Intro to Gemini 2.0 Flash](https://github.com/GoogleCloudPlatform/generative-ai/blob/sdk-updates/gemini/getting-started/intro_gemini_2_0_flash.ipynb) which uses the Google Gen AI SDK.\n",
Copy link
Contributor

Choose a reason for hiding this comment

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

low

Nit: Slightly rephrase for precision. Instead of "This notebook uses the Vertex AI SDK, which does not support Gemini 2.0", consider "This notebook uses the Vertex AI SDK for Gemini, which is not compatible with Gemini 2.0."

Suggested change
"> **NOTE:** This notebook uses the Vertex AI SDK, which does not support Gemini 2.0; refer to [Intro to Gemini 2.0 Flash](https://github.com/GoogleCloudPlatform/generative-ai/blob/sdk-updates/gemini/getting-started/intro_gemini_2_0_flash.ipynb) which uses the Google Gen AI SDK.\n",
> **NOTE:** This notebook uses the Vertex AI SDK for Gemini, which is not compatible with Gemini 2.0; refer to [Intro to Gemini 2.0 Flash](https://github.com/GoogleCloudPlatform/generative-ai/blob/sdk-updates/gemini/getting-started/intro_gemini_2_0_flash.ipynb) which uses the Google Gen AI SDK.

@@ -31,6 +31,8 @@
"source": [
"# Introduction to Long Context Window with Gemini on Vertex AI\n",
"\n",
"> **NOTE:** This notebook uses the Vertex AI SDK, which does not support Gemini 2.0; refer to [Intro to Gemini 2.0 Flash](https://github.com/GoogleCloudPlatform/generative-ai/blob/sdk-updates/gemini/getting-started/intro_gemini_2_0_flash.ipynb) which uses the Google Gen AI SDK.\n",
Copy link
Contributor

Choose a reason for hiding this comment

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

low

Nit: Slightly rephrase for precision. Instead of "This notebook uses the Vertex AI SDK, which does not support Gemini 2.0", consider "This notebook uses the Vertex AI SDK for Gemini, which is not compatible with Gemini 2.0."

Suggested change
"> **NOTE:** This notebook uses the Vertex AI SDK, which does not support Gemini 2.0; refer to [Intro to Gemini 2.0 Flash](https://github.com/GoogleCloudPlatform/generative-ai/blob/sdk-updates/gemini/getting-started/intro_gemini_2_0_flash.ipynb) which uses the Google Gen AI SDK.\n",
> **NOTE:** This notebook uses the Vertex AI SDK for Gemini, which is not compatible with Gemini 2.0; refer to [Intro to Gemini 2.0 Flash](https://github.com/GoogleCloudPlatform/generative-ai/blob/sdk-updates/gemini/getting-started/intro_gemini_2_0_flash.ipynb) which uses the Google Gen AI SDK.

@@ -31,6 +31,8 @@
"source": [
"# Prompt Design - Best Practices\n",
"\n",
"> **NOTE:** This notebook uses the Vertex AI SDK, which does not support Gemini 2.0; refer to [Intro to Gemini 2.0 Flash](https://github.com/GoogleCloudPlatform/generative-ai/blob/sdk-updates/gemini/getting-started/intro_gemini_2_0_flash.ipynb) which uses the Google Gen AI SDK.\n",
Copy link
Contributor

Choose a reason for hiding this comment

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

low

Nit: Slightly rephrase for precision. Instead of "This notebook uses the Vertex AI SDK, which does not support Gemini 2.0", consider "This notebook uses the Vertex AI SDK for Gemini, which is not compatible with Gemini 2.0."

Suggested change
"> **NOTE:** This notebook uses the Vertex AI SDK, which does not support Gemini 2.0; refer to [Intro to Gemini 2.0 Flash](https://github.com/GoogleCloudPlatform/generative-ai/blob/sdk-updates/gemini/getting-started/intro_gemini_2_0_flash.ipynb) which uses the Google Gen AI SDK.\n",
> **NOTE:** This notebook uses the Vertex AI SDK for Gemini, which is not compatible with Gemini 2.0; refer to [Intro to Gemini 2.0 Flash](https://github.com/GoogleCloudPlatform/generative-ai/blob/sdk-updates/gemini/getting-started/intro_gemini_2_0_flash.ipynb) which uses the Google Gen AI SDK.

@@ -31,6 +31,8 @@
"source": [
"# Intro to Building a Scalable and Modular RAG System with RAG Engine in Vertex AI \n",
"\n",
"> **NOTE:** This notebook uses the Vertex AI SDK, which does not support Gemini 2.0; refer to [Intro to Gemini 2.0 Flash](https://github.com/GoogleCloudPlatform/generative-ai/blob/sdk-updates/gemini/getting-started/intro_gemini_2_0_flash.ipynb) which uses the Google Gen AI SDK.\n",
Copy link
Contributor

Choose a reason for hiding this comment

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

low

Nit: Slightly rephrase for precision. Instead of "This notebook uses the Vertex AI SDK, which does not support Gemini 2.0", consider "This notebook uses the Vertex AI SDK for Gemini, which is not compatible with Gemini 2.0."

Suggested change
"> **NOTE:** This notebook uses the Vertex AI SDK, which does not support Gemini 2.0; refer to [Intro to Gemini 2.0 Flash](https://github.com/GoogleCloudPlatform/generative-ai/blob/sdk-updates/gemini/getting-started/intro_gemini_2_0_flash.ipynb) which uses the Google Gen AI SDK.\n",
> **NOTE:** This notebook uses the Vertex AI SDK for Gemini, which is not compatible with Gemini 2.0; refer to [Intro to Gemini 2.0 Flash](https://github.com/GoogleCloudPlatform/generative-ai/blob/sdk-updates/gemini/getting-started/intro_gemini_2_0_flash.ipynb) which uses the Google Gen AI SDK.

@@ -31,6 +31,8 @@
"source": [
"# Gen AI & LLM Security for developers\n",
"\n",
"> **NOTE:** This notebook uses the Vertex AI SDK, which does not support Gemini 2.0; refer to [Intro to Gemini 2.0 Flash](https://github.com/GoogleCloudPlatform/generative-ai/blob/sdk-updates/gemini/getting-started/intro_gemini_2_0_flash.ipynb) which uses the Google Gen AI SDK.\n",
Copy link
Contributor

Choose a reason for hiding this comment

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

low

Nit: Slightly rephrase for precision. Instead of "This notebook uses the Vertex AI SDK, which does not support Gemini 2.0", consider "This notebook uses the Vertex AI SDK for Gemini, which is not compatible with Gemini 2.0."

Suggested change
"> **NOTE:** This notebook uses the Vertex AI SDK, which does not support Gemini 2.0; refer to [Intro to Gemini 2.0 Flash](https://github.com/GoogleCloudPlatform/generative-ai/blob/sdk-updates/gemini/getting-started/intro_gemini_2_0_flash.ipynb) which uses the Google Gen AI SDK.\n",
> **NOTE:** This notebook uses the Vertex AI SDK for Gemini, which is not compatible with Gemini 2.0; refer to [Intro to Gemini 2.0 Flash](https://github.com/GoogleCloudPlatform/generative-ai/blob/sdk-updates/gemini/getting-started/intro_gemini_2_0_flash.ipynb) which uses the Google Gen AI SDK.

@@ -31,6 +31,8 @@
"source": [
"# Responsible AI with Gemini API in Vertex AI: Safety ratings and thresholds\n",
"\n",
"> **NOTE:** This notebook uses the Vertex AI SDK, which does not support Gemini 2.0; refer to [Intro to Gemini 2.0 Flash](https://github.com/GoogleCloudPlatform/generative-ai/blob/sdk-updates/gemini/getting-started/intro_gemini_2_0_flash.ipynb) which uses the Google Gen AI SDK.\n",
Copy link
Contributor

Choose a reason for hiding this comment

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

low

Nit: Slightly rephrase for precision. Instead of "This notebook uses the Vertex AI SDK, which does not support Gemini 2.0", consider "This notebook uses the Vertex AI SDK for Gemini, which is not compatible with Gemini 2.0."

Suggested change
"> **NOTE:** This notebook uses the Vertex AI SDK, which does not support Gemini 2.0; refer to [Intro to Gemini 2.0 Flash](https://github.com/GoogleCloudPlatform/generative-ai/blob/sdk-updates/gemini/getting-started/intro_gemini_2_0_flash.ipynb) which uses the Google Gen AI SDK.\n",
> **NOTE:** This notebook uses the Vertex AI SDK for Gemini, which is not compatible with Gemini 2.0; refer to [Intro to Gemini 2.0 Flash](https://github.com/GoogleCloudPlatform/generative-ai/blob/sdk-updates/gemini/getting-started/intro_gemini_2_0_flash.ipynb) which uses the Google Gen AI SDK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: grounding notebook does not work with gemini-2.0-flash-exp
1 participant