Repository Public
1# Gemini API cookbook23A collection of guides and examples for the Gemini API. Explore more in the4[Gemini API Cookbook on GitHub.](https://github.com/google-gemini/cookbook)56### Quickstart in Python78[9### Audio Quickstart10How to prompt Gemini 1.5 Pro using an audio file.](https://colab.research.google.com/github/google-gemini/cookbook/blob/main/quickstarts/Audio.ipynb) [11### Authentication Quickstart12Create an API key and use it with the Python SDK or a command line tool like curl.](https://colab.research.google.com/github/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) [13### OAuth Quickstart14A simplified approach to using OAuth for authentication.](https://colab.research.google.com/github/google-gemini/cookbook/blob/main/quickstarts/Authentication_with_OAuth.ipynb) [15### Tokens Quickstart16An interactive introduction to tokens and how they are used in the Gemini API.](https://colab.research.google.com/github/google-gemini/cookbook/blob/main/quickstarts/Counting_Tokens.ipynb) [17### Embeddings Quickstart18Quick code examples that show how to get started generating embeddings.](https://colab.research.google.com/github/google-gemini/cookbook/blob/main/quickstarts/Embeddings.ipynb) [19### File API Quickstart20Use the File API to upload a media file and include it in a GenerateContent call.](https://colab.research.google.com/github/google-gemini/cookbook/blob/main/quickstarts/File_API.ipynb) [21### Function Calling22Code examples to help you get started with function calling.](https://colab.research.google.com/github/google-gemini/cookbook/blob/main/quickstarts/Function_calling.ipynb) [23### Function Calling Config24A guide for those already familiar with function calling.](https://colab.research.google.com/github/google-gemini/cookbook/blob/main/quickstarts/Function_calling_config.ipynb) [25### Prompting Quickstart26How to write and run your first prompts with the Gemini API.](https://colab.research.google.com/github/google-gemini/cookbook/blob/main/quickstarts/Prompting.ipynb) [27### Safety Quickstart28How to use them the Gemini API adjustable safety settings.](https://colab.research.google.com/github/google-gemini/cookbook/blob/main/quickstarts/Safety.ipynb) [29### Streaming Quickstart30This notebook demonstrates streaming in the Python SDK.](https://colab.research.google.com/github/google-gemini/cookbook/blob/main/quickstarts/Streaming.ipynb) [31### System instructions32How to provide a system instruction when generating content.](https://colab.research.google.com/github/google-gemini/cookbook/blob/main/quickstarts/System_instructions.ipynb) [33### Tuning Quickstart34How to get started with model tuning.](https://colab.research.google.com/github/google-gemini/cookbook/blob/main/quickstarts/Tuning.ipynb) [35### Prompting with Video36Quick example of how to prompt Gemini 1.5 Pro using a video file.](https://colab.research.google.com/github/google-gemini/cookbook/blob/main/quickstarts/Video.ipynb)3738### Quickstart in Rest3940[41### Embedding Quickstart42How to get started generating embeddings using curl.](https://colab.research.google.com/github/google-gemini/cookbook/blob/main/quickstarts/rest/Embeddings_REST.ipynb) [43### Function calling44Quick code examples that show how to get started with function calling using curl.](https://colab.research.google.com/github/google-gemini/cookbook/blob/main/quickstarts/rest/Function_calling_REST.ipynb) [45### JSON Mode Quickstart46A code example that shows you how to get started with JSON mode using curl.](https://colab.research.google.com/github/google-gemini/cookbook/blob/main/quickstarts/rest/JSON_mode_REST.ipynb) [47### Prompting Quickstart48Try out the Gemini API using curl commands to call the methods in the REST API.](https://colab.research.google.com/github/google-gemini/cookbook/blob/main/quickstarts/rest/Prompting_REST.ipynb) [49### Safety Quickstart50How to use adjustable safety settings with REST.](https://colab.research.google.com/github/google-gemini/cookbook/blob/main/quickstarts/rest/Safety_REST.ipynb) [51### Streaming Quickstart52This notebook demonstrates streaming in REST.](https://colab.research.google.com/github/google-gemini/cookbook/blob/main/quickstarts/rest/Streaming_REST.ipynb) [53### System instructions54How to get started with system instructions using curl.](https://colab.research.google.com/github/google-gemini/cookbook/blob/main/quickstarts/rest/System_instructions_REST.ipynb)5556### Code examples5758[59### Anomaly detection60Use the embeddings from the Gemini API to detect potential outliers in your dataset.](https://colab.research.google.com/github/google-gemini/cookbook/blob/main/examples/Anomaly_detection_with_embeddings.ipynb) [61### Classify text62Use embeddings to train a model to classify posts based on the topic.](https://colab.research.google.com/github/google-gemini/cookbook/blob/main/examples/Classify_text_with_embeddings.ipynb) [63### Guess the shape64How to use multiple images in the same prompt with the Gemini API.](https://colab.research.google.com/github/google-gemini/cookbook/blob/main/examples/Guess_the_shape.ipynb) [65### Marketing campaign66Analyze a product sketch and create a marketing campaign \& taglines in JSON format.](https://colab.research.google.com/github/google-gemini/cookbook/blob/main/examples/Market_a_Jet_Backpack.ipynb) [67### Search Wikipedia using ReAct68Minimal implementation of ReAct: Synergizing Reasoning and Acting in Language Models](https://colab.research.google.com/github/google-gemini/cookbook/blob/main/examples/Search_Wikipedia_using_ReAct.ipynb) [69### Search re-ranking using Gemini embeddings70Use embeddings to re-rank search results.](https://colab.research.google.com/github/google-gemini/cookbook/blob/main/examples/Search_reranking_using_embeddings.ipynb) [71### Generation for Story Writing72How to write a story using prompt chaining and iterative generation.](https://colab.research.google.com/github/google-gemini/cookbook/blob/main/examples/Story_Writing_with_Prompt_Chaining.ipynb) [73### Document search with embeddings74Use the Gemini API to create embeddings so that you can perform document search.](https://colab.research.google.com/github/google-gemini/cookbook/blob/main/examples/Talk_to_documents_with_embeddings.ipynb)