{"id":13617879,"url":"https://github.com/google-gemini/cookbook","last_synced_at":"2025-05-13T20:04:14.442Z","repository":{"id":229238122,"uuid":"771670025","full_name":"google-gemini/cookbook","owner":"google-gemini","description":"Examples and guides for using the Gemini API","archived":false,"fork":false,"pushed_at":"2025-05-06T19:48:41.000Z","size":274480,"stargazers_count":12638,"open_issues_count":101,"forks_count":1667,"subscribers_count":130,"default_branch":"main","last_synced_at":"2025-05-06T19:51:53.694Z","etag":null,"topics":["gemini","gemini-api"],"latest_commit_sha":null,"homepage":"https://ai.google.dev/gemini-api/docs","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/google-gemini.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-03-13T18:19:23.000Z","updated_at":"2025-05-06T19:48:46.000Z","dependencies_parsed_at":"2024-04-29T18:27:30.499Z","dependency_job_id":"48f3d303-c9e6-4655-8259-2ccbd3b5eebf","html_url":"https://github.com/google-gemini/cookbook","commit_stats":{"total_commits":212,"total_committers":33,"mean_commits":6.424242424242424,"dds":0.7877358490566038,"last_synced_commit":"a7bc7577155000cd6ed92fca74d993ace98ef614"},"previous_names":["google-gemini/gemini-api-cookbook","google-gemini/cookbook"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google-gemini%2Fcookbook","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google-gemini%2Fcookbook/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google-gemini%2Fcookbook/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google-gemini%2Fcookbook/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/google-gemini","download_url":"https://codeload.github.com/google-gemini/cookbook/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254020474,"owners_count":22000750,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gemini","gemini-api"],"created_at":"2024-08-01T20:01:49.733Z","updated_at":"2025-05-13T20:04:09.433Z","avatar_url":"https://github.com/google-gemini.png","language":"Jupyter Notebook","funding_links":[],"categories":["Jupyter Notebook","April 2025","📚 学習リソース","🛠️ Tutorials \u0026 Cookbooks","Official","Repos","📚 Learning \u0026 Resources","LLM Cookbook / Examples","📚 Learning Resources","AI Coding Agents"],"sub_categories":["コースとチュートリアル","T6 · LLM Application Architecture","Guides \u0026 Tutorials","Gemini CLI"],"readme":"# Welcome to the Gemini API Cookbook\n\nThis cookbook provides a structured learning path for using the Gemini API, focusing on hands-on tutorials and practical examples.\n\n**For comprehensive API documentation, visit [ai.google.dev](https://ai.google.dev/gemini-api/docs).**\n\u003cbr\u003e\u003cbr\u003e\n\n## Important: Migration\n\nWith Gemini 2 we are offering a [new SDK](https://github.com/googleapis/python-genai)\n(\u003ccode\u003e[google-genai](https://pypi.org/project/google-genai/)\u003c/code\u003e,\n\u003ccode\u003ev1.0\u003c/code\u003e). The updated SDK is fully compatible with all Gemini API\nmodels and features, including recent additions like the\n[live API](https://aistudio.google.com/live) (audio + video streaming),\nimproved tool usage (\n[code execution](https://ai.google.dev/gemini-api/docs/code-execution?lang=python),\n[function calling](https://ai.google.dev/gemini-api/docs/function-calling/tutorial?lang=python) and integrated\n[Google search grounding](https://ai.google.dev/gemini-api/docs/grounding?lang=python)),\nand media generation ([Imagen](https://ai.google.dev/gemini-api/docs/imagen)).\nThis SDK allows you to connect to the Gemini API through either\n[Google AI Studio](https://aistudio.google.com/prompts/new_chat?model=gemini-2.0-flash-exp) or\n[Vertex AI](https://cloud.google.com/vertex-ai/generative-ai/docs/gemini-v2).\n\nThe \u003ccode\u003e[google-generativeai](https://pypi.org/project/google-generativeai)\u003c/code\u003e\npackage will continue to support the original Gemini models.\nIt \u003cem\u003ecan\u003c/em\u003e also be used with Gemini 2 models, just with a limited feature\nset. All new features will be developed in the new Google GenAI SDK.\n\nSee the [migration guide](https://ai.google.dev/gemini-api/docs/migrate) for details.\n\u003cbr\u003e\u003cbr\u003e\n\n## Navigating the Cookbook\n\nThis cookbook is organized into two main categories:\n\n1.  **[Quick Starts](https://github.com/google-gemini/cookbook/tree/main/quickstarts/):**  Step-by-step guides covering both introductory topics (\"[Get Started](./quickstarts/Get_started.ipynb)\") and specific API features.\n2.  **[Examples](https://github.com/google-gemini/cookbook/tree/main/examples/):** Practical use cases demonstrating how to combine multiple features.\n\nWe also showcase **Demos** in separate repositories, illustrating end-to-end applications of the Gemini API.\n\u003cbr\u003e\u003cbr\u003e\n\n## What's New?\n\nHere are the recent additions and updates to the Gemini API and the Cookbook: \n\n* **Gemini 2.0 models:** Explore the capabilities of the latest Gemini 2.0 models! See the [Get Started Guide](./quickstarts/Get_started.ipynb).\n* **Imagen**: Get started with our image generation model with this brand new [Imagen guide](./quickstarts/Get_started_imagen.ipynb)!\n* **Recently Added Guides:**\n  * [Browser as a tool](./examples/Browser_as_a_tool.ipynb): Use a web browser for live and internal (intranet) web interactions\n  * [Code execution](./quickstarts/Code_Execution.ipynb): Generating and running Python code to solve complex tasks and even output graphs\n  * [Thinking model](./quickstarts/Get_started_thinking.ipynb): Discover the thinking model capabilities.\n  \n\u003cbr\u003e\u003cbr\u003e\n\n## 1. Quick Starts\n\nThe [quickstarts section](https://github.com/google-gemini/cookbook/tree/main/quickstarts/) contains step-by-step tutorials to get you started with Gemini and learn about its specific features.\n\n**To begin, you'll need:**\n\n1.  A Google account.\n2.  An API key (create one in [Google AI Studio](https://aistudio.google.com/app/apikey)).\n\u003cbr\u003e\u003cbr\u003e\n\nWe recommend starting with the following:\n\n*   [Authentication](./quickstarts/Authentication.ipynb): Set up your API key for access.\n*   [**Get started**](./quickstarts/Get_started.ipynb): Get started with Gemini models and the Gemini API, covering basic prompting and multimodal input.\n\u003cbr\u003e\u003cbr\u003e\n\nThen, explore the other quickstarts tutorials to learn about individual features:\n*  [Get started with Live API](./quickstarts/Get_started_LiveAPI.ipynb): Get started with the live API with this comprehensive overview of its capabilities\n*  [Get started with Imagen](./quickstarts/Get_started_imagen.ipynb) and [Image-out](./quickstarts/Image_out.ipynb): Get started with our image generation capabilities \n*  [Grounding](./quickstarts/Search_Grounding.ipynb): use Google Search for grounded responses\n*  [Code execution](./quickstarts/Code_Execution.ipynb): Generating and running Python code to solve complex tasks and even ouput graphs\n*  And [many more](https://github.com/google-gemini/cookbook/tree/main/quickstarts/)\n\u003cbr\u003e\u003cbr\u003e\n\n## 2. Examples (Practical Use Cases)\n\nThese examples demonstrate how to combine multiple Gemini API features or 3rd-party tools to build more complex applications.\n*  [Illustrate a book](./examples/Book_illustration.ipynb): Use Gemini and Imagen to create illustration for an open-source book\n*  [Animated Story Generation](./examples/Animated_Story_Video_Generation_gemini.ipynb): Create animated videos by combining Gemini's story generation, Imagen, and audio synthesis\n*  [Plotting and mapping Live](./examples/LiveAPI_plotting_and_mapping.ipynb): Mix *Live API* and *Code execution* to solve complex tasks live\n*  [3D Spatial understanding](./examples/Spatial_understanding_3d.ipynb): Use Gemini *3D spatial* abilities to understand 3D scenes\n*  [Gradio and live API](./examples/gradio_audio.py): Use gradio to deploy your own instance of the *Live API*\n*  And [many many more](https://github.com/google-gemini/cookbook/tree/main/examples/)\n\u003cbr\u003e\u003cbr\u003e\n\n## 3. Demos (End-to-End Applications)\n\nThese fully functional, end-to-end applications showcase the power of Gemini in real-world scenarios. \n\n*   [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\n*   [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\n*   [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\n\u003cbr\u003e\u003cbr\u003e\n\n\n## Official SDKs\n\nThe Gemini API is a REST API. You can call it directly using tools like `curl` (see [REST examples](https://github.com/google-gemini/cookbook/tree/main/quickstarts/rest/) or the great [Postman workspace](https://www.postman.com/ai-on-postman/google-gemini-apis/overview)), or use one of our official SDKs:\n* [Python](https://github.com/googleapis/python-genai)\n* [Go](https://github.com/google/generative-ai-go)\n* [Node.js](https://github.com/google/generative-ai-js)\n* [Dart (Flutter)](https://github.com/google/generative-ai-dart)\n* [Android](https://github.com/google/generative-ai-android)\n* [Swift](https://github.com/google/generative-ai-swift)\n\u003cbr\u003e\u003cbr\u003e\n\n\n## Get Help\n\nAsk a question on the [Google AI Developer Forum](https://discuss.ai.google.dev/).\n\n## The Gemini API on Google Cloud Vertex AI\n\nFor enterprise developers, the Gemini API is also available on Google Cloud Vertex AI. See [this repo](https://github.com/GoogleCloudPlatform/generative-ai) for examples.\n\n## Contributing\n\nContributions are welcome! See [CONTRIBUTING.md](CONTRIBUTING.md) for details.\n\nThank you for developing with the Gemini API! We're excited to see what you create.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogle-gemini%2Fcookbook","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoogle-gemini%2Fcookbook","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogle-gemini%2Fcookbook/lists"}