You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> This SDK has been deprecated in favor of the new SDK `google-genai` ([github](https://github.com/googleapis/python-genai),
9
-
[pypi](https://pypi.org/project/google-genai/)). From Gemini 2.0 onwards the old SDK, `google-generativeai`, will no longer be
10
-
developing new features. The old SDK can run a subset of Gemini-2.0 model
11
-
features. Any new code should be written using the new SDK, `google-genai`.
8
+
> From Gemini 2.0 onwards this SDK will no longer be
9
+
developing new features. Any new code should be written using the new SDK, `google-genai` ([github](https://github.com/googleapis/python-genai),
10
+
[pypi](https://pypi.org/project/google-genai/)). See the migration guide below to upgrade to the new SDK.
12
11
13
-
Use the new SDK, [google-genai]((https://github.com/googleapis/python-genai)), for any new code from Gemini 2.0 onwards:
12
+
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.
1. Go to [Google AI Studio](https://aistudio.google.com/).
16
+
2. Login with your Google account.
17
+
3.[Create](https://aistudio.google.com/app/apikey) an API key.
18
+
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/).
19
+
5. For detailed instructions, try the
20
+
[Python SDK tutorial](https://ai.google.dev/tutorials/python_quickstart) on [ai.google.dev](https://ai.google.dev).
24
21
25
22
## Upgrade to the new Google Gen AI SDK for Python
26
23
27
-
Follow the migration guide below to upgrade your code to the new SDK.
28
-
29
-
<details>
30
-
<summary>Migration guide</summary>
31
-
32
-
Until now, the `google-generativeai` SDK package has been the recommended tool
24
+
Until now, the `google-generativeai` SDK package has been the recommended tool
33
25
for accessing the Gemini API from Python. While this package gets the job done,
34
26
the long incremental development process (starting from the PaLM API in 2023)
35
27
made it impossible to implement some important high level features without
@@ -47,9 +39,19 @@ resolve these problems. Among other things, the new package:
47
39
* Follows the API layout closely; paths and data structures mostly match
48
40
between the SDK and the REST interface.
49
41
50
-
Any new code should be written using the new SDK, `google-genai`.
42
+
From Gemini 2.0 onwards the old SDK, `google-generativeai`, will no longer be
43
+
developing new features. The old SDK can run a subset of Gemini-2.0 model
44
+
features. Any new new code should be written using the new SDK, `google-genai`.
51
45
52
-
To upgrade your code to use the new SDK, follow these steps:
If you still want to build with this old SDK, follow these steps:
959
-
960
-
1. Go to [Google AI Studio](https://aistudio.google.com/).
961
-
2. Login with your Google account.
962
-
3.[Create](https://aistudio.google.com/app/apikey) an API key.
963
-
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/).
964
-
5. For detailed instructions, try the
965
-
[Python SDK tutorial](https://ai.google.dev/tutorials/python_quickstart) on [ai.google.dev](https://ai.google.dev).
0 commit comments