Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Live API content reorg #423

Merged
merged 79 commits into from
Feb 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
3482427
get started in quickstarts
Giom-V Jan 24, 2025
0ab4b95
Redirection to the qwuickstart folder
Giom-V Jan 24, 2025
aae21dd
Merge branch 'google-gemini:main' into cookbook-reorg
Giom-V Jan 27, 2025
f0074d6
Using Flash 2.0 by default
Giom-V Jan 27, 2025
6a75478
Merge branch 'google-gemini:main' into flash-2.0-ga
Giom-V Jan 27, 2025
a75c4bc
Moving search-as-a-tool notebook and updating models
Giom-V Jan 27, 2025
94cee10
Moving get started and updating model
Giom-V Jan 27, 2025
75303c5
Caching requires a fixed version
Giom-V Jan 27, 2025
cdebe9c
Merge branch 'flash-2.0-ga' of https://github.com/Giom-V/gemini-api-c…
Giom-V Jan 27, 2025
ae77c90
Caching is not compatible with Flash 2.0 at the moment
Giom-V Jan 27, 2025
b63b6c1
Moving plotting and Mapping
Giom-V Jan 27, 2025
293f5bd
Moving the search tool notebook in quickstart
Giom-V Jan 27, 2025
2afc044
Moving the spatial understanding notebooks in the example folder
Giom-V Jan 27, 2025
95f6b1c
Fixing colab urls
Giom-V Jan 27, 2025
7cd5ba1
Spatial understanding in quickstarts instead
Giom-V Jan 27, 2025
b738ad8
Moving thinking notebook in quickstarts
Giom-V Jan 28, 2025
50c3e77
Fixing links
Giom-V Jan 28, 2025
ea3bfb3
Moving video understanding to quickstarts folder
Giom-V Jan 28, 2025
fc45710
Merge branch 'google-gemini:main' into cookbook-reorg
Giom-V Jan 28, 2025
41915ed
Moving the gradio example in examples (but maybe it should be quickst…
Giom-V Jan 28, 2025
1a85d49
Updating readmes
Giom-V Jan 28, 2025
d3f461a
Formatting
Giom-V Jan 28, 2025
3a9872d
Fixing links and formatting
Giom-V Jan 28, 2025
1f11f19
Delete quickstarts/get_started.ipynb
Giom-V Jan 28, 2025
1fc7ce4
Formating chat
Giom-V Jan 28, 2025
1cc410a
Ignoring lint for notebooks in the gemini-2
Giom-V Jan 28, 2025
8c2f8b5
Fixing colab logos urls
Giom-V Jan 29, 2025
b2ec4fb
Merge branch 'main' into cookbook-reorg
Giom-V Jan 29, 2025
0bf55c6
Format
Giom-V Jan 29, 2025
3b882f1
Moving live API starter notebook and py code example
Giom-V Jan 29, 2025
0f2dd04
Renaming Live API notebook and py file and updating links
Giom-V Jan 29, 2025
7ea8766
Updating copyright year
Giom-V Jan 29, 2025
d29ec34
Fixing model variable
Giom-V Jan 29, 2025
cc072f8
Fixing last mistakes
Giom-V Jan 29, 2025
5c3cbfd
formatting
Giom-V Jan 29, 2025
2c4f59e
Fixing links
Giom-V Jan 29, 2025
0a57a53
Merge branch 'main' into flash-2.0-ga
Giom-V Feb 4, 2025
2702d84
Replacing the object detection by the spatial one
Giom-V Feb 4, 2025
eef45ff
Fixing models
Giom-V Feb 4, 2025
ed255d4
New models
Giom-V Feb 4, 2025
0b574d3
Model update to 2.0
Giom-V Feb 5, 2025
f3f591c
Formatting
Giom-V Feb 5, 2025
469a506
Updating references to Flash 1.5 in texts
Giom-V Feb 5, 2025
2fb6c03
Update references to 1.5 Pro in texts
Giom-V Feb 5, 2025
055a493
Timess texts
Giom-V Feb 5, 2025
913dbb3
Lint
Giom-V Feb 5, 2025
d4844db
Adding readmes to the sub-folders
Giom-V Feb 5, 2025
425347d
Updating links in the readmes
Giom-V Feb 5, 2025
d86a5bb
Updating the weaviate link
Giom-V Feb 5, 2025
83196e5
Exclude list from lint
Giom-V Feb 5, 2025
c6a613b
Merge branch 'flash-2.0-ga' into liveAPI_reorg
Giom-V Feb 5, 2025
c4fa422
Spatial understanding
Giom-V Feb 5, 2025
af18ded
Merge branch 'google-gemini:main' into liveAPI_reorg
Giom-V Feb 5, 2025
a458891
Ignore ini files
Giom-V Feb 5, 2025
7297050
Format
Giom-V Feb 5, 2025
15bb602
Recovering erased content
Giom-V Feb 5, 2025
67b1df2
Format
Giom-V Feb 5, 2025
2a159ac
Moving tool use out of the Gemini 2 folder
Giom-V Feb 5, 2025
bf56b53
Renaming tool use notebook
Giom-V Feb 5, 2025
2eff6ea
Updating links to the tool use notebook
Giom-V Feb 5, 2025
ae0b990
Readme
Giom-V Feb 5, 2025
e1de07e
Foormatting
Giom-V Feb 5, 2025
4f4b692
Fixing links
Giom-V Feb 5, 2025
6d96df7
Fixing name in instructions
Giom-V Feb 5, 2025
d4c2526
Fixing links
Giom-V Feb 5, 2025
ea4af77
Deleting the awesome gemini page
Giom-V Feb 5, 2025
10f45c4
test
Giom-V Feb 5, 2025
26a916d
Organizing the links in an array
Giom-V Feb 5, 2025
a4bb8f4
Better array
Giom-V Feb 5, 2025
b9ae3d5
Fixing links
Giom-V Feb 5, 2025
7f0aeb2
fixing link
Giom-V Feb 5, 2025
048f62c
Fixing links to quickstarts/Spatial_understanding notebook
Giom-V Feb 6, 2025
a157f5d
Fixing link to Json capabilities folder
Giom-V Feb 6, 2025
09b9289
Merge branch 'main' into liveAPI_reorg
Giom-V Feb 6, 2025
3421fe9
Fixing video links
Giom-V Feb 6, 2025
267ecea
Merge branch 'main' into liveAPI_reorg
Giom-V Feb 6, 2025
549bd5f
Merge branch 'main' into liveAPI_reorg
Giom-V Feb 6, 2025
3854e4e
Formatting
Giom-V Feb 6, 2025
a1cbd8b
Merge branch 'liveAPI_reorg' of https://github.com/Giom-V/gemini-api-…
Giom-V Feb 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
**/.ipynb_checkpoints
**/venv
**/.python-version
**/desktop.ini
68 changes: 0 additions & 68 deletions Awesome_gemini.md

This file was deleted.

28 changes: 15 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ Prefer the `google-genai` for any new code going forward.

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.
1. **[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.
2. **[Examples](https://github.com/google-gemini/cookbook/tree/main/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>
Expand All @@ -34,12 +34,13 @@ Here are the recent additions and updates to the Gemini API and the Cookbook:
* **Recently Added Guides:**.
* [Thinking model](./quickstarts/Get_started_thinking.ipynb): Discover the thinking model capabilities.
* [Invoice and Form Data Extraction](./examples/Pdf_structured_outputs_on_invoices_and_forms.ipynb): Analyze PDFs with structured outputs.
* [Gradio and Live API](./examples/Code_.ipynb): Start working with Gradio to set-up your own live instance.
* [Code execution](./quickstarts/Code_Execution.ipynb): Generating and running Python code to solve complex tasks and even ouput graphs

<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.
The [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.

**To begin, you'll need:**

Expand All @@ -53,20 +54,21 @@ We recommend starting with the following:
* [**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:
Then, explore the other quickstarts tutorials to learn about individual features:
* [Get started with Live API](./quickstarts/Get_started_LiveAPI.ipynb): Get started with the live API with this comprehensive overview of its capabilities
* [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/)
* [Code execution](./quickstarts/Code_Execution.ipynb): Generating and running Python code to solve complex tasks and even ouput graphs
* And [many more](https://github.com/google-gemini/cookbook/tree/main/quickstarts/)
<br><br>

## 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/)
* [Plotting and mapping Live](./examples/LiveAPI_plotting_and_mapping.ipynb): Mix *Live API* and *Code execution* to solve complex tasks live.
* [Search grounding for research report](./examples/Search_grounding_for_research_report.ipynb): Use *Grounding* to improve the quality of your research report
* [3D Spatial understanding](./examples/Spatial_understanding_3d.ipynb): Use Gemini *3D spatial* abilities to understand 3D scenes
* [Gradio and live API](./examples/gradio_audio.py): Use gradio to deploy your own instance of the *Live API*
* And [many many more](https://github.com/google-gemini/cookbook/tree/main/examples/)
<br><br>

## 3. Demos (End-to-End Applications)
Expand All @@ -81,7 +83,7 @@ These fully functional, end-to-end applications showcase the power of Gemini in

## Official SDKs

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:
The 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 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)
Expand Down
2 changes: 1 addition & 1 deletion examples/Analyze_a_Video_Classification.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
"source": [
"## Example\n",
"\n",
"This example uses a [video](https://commons.wikimedia.org/wiki/File:American_black_bears_(Ursus_americanus).webm) published by Bryon Evans containing an American black bear.\n",
"This example uses a [video](https://commons.wikimedia.org/wiki/File:American_black_bears_%28Ursus_americanus%29.webm) published by Bryon Evans containing an American black bear.\n",
"\n",
"The video falls under the [Creative Commons Attribution 3.0 Unported license](https://creativecommons.org/licenses/by/3.0/deed.en)."
]
Expand Down
8 changes: 4 additions & 4 deletions examples/LiveAPI_plotting_and_mapping.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1100,11 +1100,11 @@
"This guide shows more intermedite use of the Multimodal Live API over Websockets.\n",
"\n",
"- To try multimodal streaming, use [Live API in Google AI Studio](https://aistudio.google.com/app/live) - no code required.\n",
"- Check out the [Live API starter using the Python SDK](../gemini-2/live_api_starter.ipynb) or using [websockets](../gemini-2/websockets/live_api_starter.ipynb).\n",
"- Try some other [search](../gemini-2/search_tool.ipynb) examples.\n",
"- Try the [Tool use in the live API tutorial](../gemini-2/live_api_tool_use.ipynb) for a walkthrough of Gemini 2.0's new tool use capabilities.\n",
"- Check out the [Live API starter using the Python SDK](../quickstarts/Get_started_LiveAPI.ipynb) or using [websockets](../gemini-2/websockets/live_api_starter.ipynb).\n",
"- Try some other [grounding](../examples/Search_grounding_for_research_report.ipynb) examples.\n",
"- Try the [Tool use in the live API tutorial](../quickstarts/Get_started_LiveAPI_tools.ipynb) for a walkthrough of Gemini 2.0's new tool use capabilities.\n",
"\n",
"Or just check the other Gemini 2.0 capabilities illustrated in the [Cookbook](https://github.com/google-gemini/cookbook/blob/main/gemini-2/) examples."
"Or just check the other Gemini 2.0 capabilities illustrated in the [Cookbook](https://github.com/google-gemini/cookbook/tree/main/gemini-2/) examples."
]
}
],
Expand Down
23 changes: 13 additions & 10 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,17 @@ For introductions to those features it is recommended to start with the [Quickst

This is a collection of fun and helpful examples for the Gemini API.

* [Plotting and mapping Live](./LiveAPI_plotting_and_mapping.ipynb): Ask Gemini for complex graphs live (Uses **Live API** and **Code execution**)
* [Search grounding for research report](./Search_grounding_for_research_report.ipynb): Use grounding to improve the quality of your research report (Uses **Grounding**)
* [3D Spatial understanding](./Spatial_understanding_3d.ipynb): Use Gemini 3D spatial abilities to understand 3D scenes and answer questions about them (Uses **Multimodal** and **Spatial understanding**)
* [Gradio and live API](./gradio_audio.py): Use gradio to deploy your own instance of the Live API (Uses **Live API**)
* [Automated Invoice and Form Data Extraction with Gemini API & Pydantic](./Pdf_structured_outputs_on_invoices_and_forms.ipynb): Use the Gemini API to extract information from PDFs (Uses **File API** and **Structured Outputs**)
<br><br>
| Cookbook | Description | Features | Open |
| -------- | ----------- | -------- | ---- |
| [Plotting and mapping Live](./LiveAPI_plotting_and_mapping.ipynb) | Ask Gemini for complex graphs live | Live API, Code execution | [![Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/google-gemini/cookbook/blob/main/examples/LiveAPI_plotting_and_mapping.ipynb) |
| [Search grounding for research report](./Search_grounding_for_research_report.ipynb) | Use grounding to improve the quality of your research report | Grounding | [![Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/google-gemini/cookbook/blob/main/examples/Search_grounding_for_research_report.ipynb) |
| [3D Spatial understanding](./Spatial_understanding_3d.ipynb) | Use Gemini 3D spatial abilities to understand 3D scenes and answer questions about them | Multimodal, Spatial understanding | [![Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/google-gemini/cookbook/blob/main/examples/Spatial_understanding_3d.ipynb) |
| [Gradio and live API](./gradio_audio.py) | Use gradio to deploy your own instance of the Live API | Live API | [Python Code](./gradio_audio.py) |
| [Invoice and Form Data Extraction](./Pdf_structured_outputs_on_invoices_and_forms.ipynb) | Use the Gemini API to extract information from PDFs | File API, Structured Outputs | [![Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/google-gemini/cookbook/blob/main/examples/Pdf_structured_outputs_on_invoices_and_forms.ipynb) |


---
<br>
Some old examples are still using the legacy SDK, they should still work and are still worth checking to get ideas:

* [Agents and Automatic Function Calling](./Agents_Function_Calling_Barista_Bot.ipynb): Create an agent (Barrista-bot) to take your coffee order.
Expand Down Expand Up @@ -48,7 +51,7 @@ Some old examples are still using the legacy SDK, they should still work and are

### Folders

* [Prompting examples](./prompting): A directory with examples of various prompting techniques.
* [JSON Capabilities](./json-capabilities): A directory with guides containing different types of tasks you can do with JSON schemas.
* [Automate Google Workspace tasks with the Gemini API](./Apps_script_and_Workspace_codelab): This codelabs shows you how to connect to the Gemini API using Apps Script, and uses the function calling, vision and text capabilities to automate Google Workspace tasks - summarizing a document, analyzing a chart, sending an email and generating some slides directly. All of this is done from a free text input.
* [Langchain examples](./langchain): A directory with multiple examples using Gemini with Langchain.
* [Prompting examples](./prompting/): A directory with examples of various prompting techniques.
* [JSON Capabilities](./json_capabilities/): A directory with guides containing different types of tasks you can do with JSON schemas.
* [Automate Google Workspace tasks with the Gemini API](./Apps_script_and_Workspace_codelab/): This codelabs shows you how to connect to the Gemini API using Apps Script, and uses the function calling, vision and text capabilities to automate Google Workspace tasks - summarizing a document, analyzing a chart, sending an email and generating some slides directly. All of this is done from a free text input.
* [Langchain examples](./langchain/): A directory with multiple examples using Gemini with Langchain.
4 changes: 2 additions & 2 deletions examples/Search_grounding_for_research_report.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1149,9 +1149,9 @@
"\n",
"* To learn more about the search tool, check out the [Search tool documentation](https://ai.google.dev/gemini-api/docs/models/gemini-v2#search-tool).\n",
"* To get started with streaming, check out the [Streaming Quickstart](../quickstarts/Streaming.ipynb).\n",
"* To get started with the search tool, check out the [Search tool quick start](https://github.com/google-gemini/cookbook/blob/main/gemini-2/search_tool.ipynb).\n",
"* To get started with the search tool, check out the [Search tool quick start](../quickstarts/Search_Grounding.ipynb).\n",
"* To see how much easier and more powerful the search tool in Gemini 2.0 is than the previous search grounding feature, compare this tutorial with the [previous example](../examples/Search_grounding_for_research_report.ipynb).\n",
"* To learn more about all the new Gemini 2.0 features, check out the [Gemini 2.0 quickstart notebooks](../gemini-2/)."
"* To learn more about all the new Gemini 2.0 features, check out the [Gemini 2.0 quickstart notebooks](https://github.com/google-gemini/cookbook/tree/main/gemini-2/)."
]
}
],
Expand Down
Loading
Loading