-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moving the gemini-2 content in the quickstarts and exemples folders * get started guides in quickstarts * complex examples in demos * Fixing colab urls * Fixing links * Updating readmes for better clarity on the organization * Fixing colab logos urls
- Loading branch information
Showing
33 changed files
with
13,361 additions
and
14,026 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,94 @@ | ||
# Welcome to the Gemini API Cookbook | ||
This is a collection of guides and examples for the Gemini API, including [quickstart](https://github.com/google-gemini/cookbook/tree/main/quickstarts) tutorials for writing prompts and using different features of the API, and [examples](https://github.com/google-gemini/cookbook/tree/main/examples) of things you can build. | ||
|
||
${\Large \textbf{\color[rgb]{0.12941,0.48235,0.99608}N\color[rgb]{0.57647,0.60392,1}e\color[rgb]{0.91765,0.47843,0.72157}w\color[rgb]{0.93333,0.30196,0.36471}:}}$ Check out the latest Gemini 2.0 capabilities in [the docs](https://ai.google.dev/gemini-api/docs/models/gemini-v2), [Google AI Studio](https://aistudio.google.com/app/live?model=gemini-2.0-flash-exp) and here in the [cookbook](./gemini-2/). | ||
This cookbook provides a structured learning path for using the Gemini API, focusing on hands-on tutorials and practical examples. | ||
|
||
## Get started 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, code, and audio. You can use these to develop a [range of applications](https://ai.google.dev/examples/). | ||
**For comprehensive API documentation, visit [ai.google.dev](https://ai.google.dev/gemini-api/docs).** | ||
<br><br> | ||
|
||
### Start developing | ||
1. Go to [Google AI Studio](https://aistudio.google.com/). | ||
2. Log in with your Google account. | ||
3. [Create](https://aistudio.google.com/app/apikey) an API key. | ||
4. Use a [quickstart](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Prompting.ipynb) for Python, or call the REST API [using curl](https://github.com/google-gemini/cookbook/blob/main/quickstarts/rest/Prompting_REST.ipynb). | ||
## Navigating the Cookbook | ||
|
||
This cookbook is organized into two main categories: | ||
|
||
1. **[Quick Starts](./quickstarts/):** Step-by-step guides covering both introductory topics ("[Get Started](./quickstarts/Get_started.ipynb)") and specific API features. | ||
2. **[Examples](./examples/):** Practical use cases demonstrating how to combine multiple features. | ||
|
||
We also showcase **Demos** in separate repositories, illustrating end-to-end applications of the Gemini API. | ||
<br><br> | ||
|
||
## What's New? | ||
We're excited to show you the latest additions to the Gemini API, and new notebooks. | ||
* [Gemini 2.0](./gemini-2/): Explore the capabilities of the new Gemini 2.0 model, including [multimodal Live API](./gemini-2/live_api_starter.ipynb), [audio streaming applications with tool use](./gemini-2/live_api_tool_use.ipynb) and [Spatial understanding](./gemini-2/spatial_understanding.ipynb). | ||
|
||
## Table of contents | ||
Here are the recent additions and updates to the Gemini API and the Cookbook: | ||
|
||
* **Gemini 2.0 Flash experimental:** Explore the capabilities of the latest Gemini 2.0 Flash experimental model! See the [Get Started Guide](./quickstarts/Get_started.ipynb). | ||
* **Recently Added Guides:**. | ||
* [Thinking model](./quickstarts/Get_started_thinking.ipynb): Discover the thinking model capabilities. | ||
* [Gradio and Live API](./examples/Code_.ipynb): Start working with Gradio to set-up your own live instance. | ||
<br><br> | ||
|
||
## 1. Quick Starts | ||
|
||
The [quickstarts section](./quickstarts/) contains step-by-step tutorials to get you started with Gemini and learn about its specific features. | ||
|
||
**To begin, you'll need:** | ||
|
||
1. A Google account. | ||
2. An API key (create one in [Google AI Studio](https://aistudio.google.com/app/apikey)). | ||
<br><br> | ||
|
||
We recommend starting with the following: | ||
|
||
* [Authentication](./quickstarts/Authentication.ipynb): Set up your API key for access. | ||
* [**Get started**](./quickstarts/Get_started.ipynb): Get started with Gemini models and the Gemini API, covering basic prompting and multimodal input. | ||
<br><br> | ||
|
||
Then, explore the other Quick Starts to learn about individual features: | ||
* [Grounding](./quickstarts/Search_Grounding.ipynb): use Google Search for grounded responses | ||
* [Code execution](./quickstarts/Code_Execution.ipynb): SGenerating and running Python code to solve complex tasks | ||
* And [many more](./quickstarts/) | ||
<br><br> | ||
|
||
Learn about the capabilities of the Gemini API by checking out these quickstart tutorials. | ||
* [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb): Start here to learn how you can set up your API key so you can get access to the Gemini API. | ||
* [Counting Tokens](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Counting_Tokens.ipynb) Tokens are the basic inputs to the Gemini models. Through this notebook, you will gain a better understanding of tokens through an interactive experience. | ||
* [Files](https://github.com/google-gemini/cookbook/blob/main/quickstarts/File_API.ipynb): Use the Gemini API to upload files (text, code, images, audio, video) and write prompts using them. | ||
* [Audio](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Audio.ipynb): Learn how to use the Gemini API with audio files. | ||
* [JSON mode](https://github.com/google-gemini/cookbook/blob/main/quickstarts/JSON_mode.ipynb): Discover how to use JSON mode. | ||
* [Function Calling](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Function_calling.ipynb): The Gemini API works great with code. Use this quickstart to learn how to write prompts to understand and call functions. Then check out the [function calling config](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Function_calling_config.ipynb) tutorial to learn more. | ||
* [System Instructions](https://github.com/google-gemini/cookbook/blob/main/quickstarts/System_instructions.ipynb): Give models additional context on how to respond by setting system instructions. | ||
* [Embeddings](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Embeddings.ipynb): Create high-quality and task-specific embeddings. | ||
* [Tuning](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Tuning.ipynb): Learn how to improve model performance on a specific task through tuning. | ||
* [Code execution](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Code_Execution.ipynb): Solve complex tasks by Generating and running Python code based on plain-text instructions. | ||
## 2. Examples (Practical Use Cases) | ||
|
||
These examples demonstrate how to combine multiple Gemini API features or 3rd-party tools to build more complex applications. | ||
* [Plotting and mapping Live](./LiveAPI_plotting_and_mapping.ipynb): Mix *Live API* and *Code execution* to solve complex tasks live. | ||
* [Search grounding for research report](./Search_grounding_for_research_report.ipynb): Use *Grounding* to improve the quality of your research report | ||
* [3D Spatial understanding](./Spatial_understanding_3d.ipynb): Use Gemini *3D spatial* abilities to understand 3D scenes | ||
* [Gradio and live API](./gradio_audio.py): Use gradio to deploy your own instance of the *Live API* | ||
* And [many many more](./examples/) | ||
<br><br> | ||
|
||
## 3. Demos (End-to-End Applications) | ||
|
||
These fully functional, end-to-end applications showcase the power of Gemini in real-world scenarios. | ||
|
||
* [Gemini API quickstart](https://github.com/google-gemini/gemini-api-quickstart): Python Flask App running with the Google AI Gemini API, designed to get you started building with Gemini's multi-modal capabilities | ||
* [Multimodal Live API Web Console](https://github.com/google-gemini/multimodal-live-api-web-console): React-based starter app for using the Multimodal Live API over a websocket | ||
* [Google AI Studio Starter Applets](https://github.com/google-gemini/starter-applets): A collection of small apps that demonstrate how Gemini can be used to create interactive experiences | ||
<br><br> | ||
|
||
You can find lots more in the [quickstarts folder](https://github.com/google-gemini/cookbook/tree/main/quickstarts), and check out the [examples folder](https://github.com/google-gemini/cookbook/tree/main/examples) for fun examples. We're also maintaining an [Awesome Gemini](Awesome_gemini.md) list of all the cool projects the community is building using Gemini. | ||
|
||
## Official SDKs | ||
The Gemini API is a REST API. You can call the API using a command line tool like `curl` (and you can find REST examples [here](https://github.com/google-gemini/cookbook/tree/main/quickstarts/rest)), or by using one of our [official SDKs](https://ai.google.dev/gemini-api/docs/downloads): | ||
* Python: [Google GenAI SDKs](https://github.com/googleapis/python-genai) will eventually replace the older [Developer SDK](https://github.com/google/generative-ai-python). | ||
|
||
The Gemini API is a REST API. You can call it directly using tools like `curl` (see [REST examples](./quickstarts/rest/)), or use one of our official SDKs: | ||
* [Python](https://github.com/googleapis/python-genai) | ||
* [Go](https://github.com/google/generative-ai-go) | ||
* [Node.js](https://github.com/google/generative-ai-js) | ||
* [Dart (Flutter)](https://github.com/google/generative-ai-dart) | ||
* [Android](https://github.com/google/generative-ai-android) | ||
* [Swift](https://github.com/google/generative-ai-swift) | ||
* [Go](https://github.com/google/generative-ai-go) | ||
<br><br> | ||
|
||
|
||
## Get Help | ||
|
||
## Get help | ||
Ask a question on the [Google AI Developer Forum](https://discuss.ai.google.dev/). | ||
|
||
## The Gemini API on Google Cloud Vertex AI | ||
If you're an enterprise developer looking to build on a fully managed platform, you can also use the Gemini API on Google Cloud. Check out this [repo](https://github.com/GoogleCloudPlatform/generative-ai) for lots of cool examples. | ||
|
||
For enterprise developers, the Gemini API is also available on Google Cloud Vertex AI. See [this repo](https://github.com/GoogleCloudPlatform/generative-ai) for examples. | ||
|
||
## Contributing | ||
Contributions are welcome. See [contributing](https://github.com/google-gemini/cookbook/blob/main/CONTRIBUTING.md) to learn more. | ||
|
||
Thank you for developing with the Gemini API! We’re excited to see what you create. | ||
Contributions are welcome! See [CONTRIBUTING.md](CONTRIBUTING.md) for details. | ||
|
||
Thank you for developing with the Gemini API! We’re excited to see what you create. |
Oops, something went wrong.