From 81eda543007c1e6e2dfc1add6748e75a6603c880 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20L=C3=B6ber?= Date: Thu, 6 Feb 2025 20:40:21 +0100 Subject: [PATCH] Add Important note in the top --- README.md | 59 ++++++++++++++++++++++--------------------------------- 1 file changed, 24 insertions(+), 35 deletions(-) diff --git a/README.md b/README.md index f9fb08fcd..52d8c3f93 100644 --- a/README.md +++ b/README.md @@ -5,31 +5,23 @@ ![PyPI - Downloads](https://img.shields.io/pypi/dd/google-generativeai) > [!IMPORTANT] -> This SDK has been deprecated in favor of the new SDK `google-genai` ([github](https://github.com/googleapis/python-genai), -[pypi](https://pypi.org/project/google-genai/)). From Gemini 2.0 onwards the old SDK, `google-generativeai`, will no longer be -developing new features. The old SDK can run a subset of Gemini-2.0 model -features. Any new code should be written using the new SDK, `google-genai`. +> From Gemini 2.0 onwards this SDK will no longer be +developing new features. Any new code should be written using the new SDK, `google-genai` ([github](https://github.com/googleapis/python-genai), +[pypi](https://pypi.org/project/google-genai/)). See the migration guide below to upgrade to the new SDK. -Use the new SDK, [google-genai]((https://github.com/googleapis/python-genai)), for any new code from Gemini 2.0 onwards: +The Google AI Python SDK is an easy way for Python developers to build with the Gemini API. The Gemini API gives you access to Gemini [models](https://ai.google.dev/models/gemini) created by [Google DeepMind](https://deepmind.google/technologies/gemini/#introduction). Gemini models are built from the ground up to be multimodal, so you can reason seamlessly across text, images, and code. - - -
- - - Try the new SDK in Google Colab - -
-

+## Get started with the Gemini API +1. Go to [Google AI Studio](https://aistudio.google.com/). +2. Login with your Google account. +3. [Create](https://aistudio.google.com/app/apikey) an API key. +4. Try a Python SDK [quickstart](https://github.com/google-gemini/gemini-api-cookbook/blob/main/quickstarts/Prompting.ipynb) in the [Gemini API Cookbook](https://github.com/google-gemini/gemini-api-cookbook/). +5. For detailed instructions, try the +[Python SDK tutorial](https://ai.google.dev/tutorials/python_quickstart) on [ai.google.dev](https://ai.google.dev). ## Upgrade to the new Google Gen AI SDK for Python -Follow the migration guide below to upgrade your code to the new SDK. - -
- Migration guide - - Until now, the `google-generativeai` SDK package has been the recommended tool +Until now, the `google-generativeai` SDK package has been the recommended tool for accessing the Gemini API from Python. While this package gets the job done, the long incremental development process (starting from the PaLM API in 2023) made it impossible to implement some important high level features without @@ -47,9 +39,19 @@ resolve these problems. Among other things, the new package: * Follows the API layout closely; paths and data structures mostly match between the SDK and the REST interface. -Any new code should be written using the new SDK, `google-genai`. +From Gemini 2.0 onwards the old SDK, `google-generativeai`, will no longer be +developing new features. The old SDK can run a subset of Gemini-2.0 model +features. Any new new code should be written using the new SDK, `google-genai`. -To upgrade your code to use the new SDK, follow these steps: + + +
+ + + Try the new SDK in Google Colab + +
+

### Install the SDK @@ -950,16 +952,3 @@ response = client.models.generate_content( contents='55', ) ``` - -
- -## Get started with the Gemini API - -If you still want to build with this old SDK, follow these steps: - -1. Go to [Google AI Studio](https://aistudio.google.com/). -2. Login with your Google account. -3. [Create](https://aistudio.google.com/app/apikey) an API key. -4. Try a Python SDK [quickstart](https://github.com/google-gemini/gemini-api-cookbook/blob/main/quickstarts/Prompting.ipynb) in the [Gemini API Cookbook](https://github.com/google-gemini/gemini-api-cookbook/). -5. For detailed instructions, try the -[Python SDK tutorial](https://ai.google.dev/tutorials/python_quickstart) on [ai.google.dev](https://ai.google.dev). \ No newline at end of file