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

Add a tutorial of generating company research report using search tool #371

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
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
2 changes: 1 addition & 1 deletion examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ This is a collection of fun examples for the Gemini API.
* [Translate a public domain](./Translate_a_Public_Domain_Book.ipynb): In this notebook, you will explore Gemini model as a translation tool, demonstrating how to prepare data, create effective prompts, and save results into a `.txt` file.
* [Working with Charts, Graphs, and Slide Decks](./Working_with_Charts_Graphs_and_Slide_Decks.ipynb): Gemini models are powerful multimodal LLMs that can process both text and image inputs. This notebook shows how Gemini 1.5 Flash model is capable of extracting data from various images.
* [Entity extraction](./Entity_Extraction.ipynb): Use Gemini API to speed up some of your tasks, such as searching through text to extract needed information. Entity extraction with a Gemini model is a simple query, and you can ask it to retrieve its answer in the form that you prefer.
* [Generate a company research report using search grounding](./search_grounding_for_research_report.ipynb): Use search grounding to write a company research report with Gemini 1.5 Flash.
* [Generate a company research report using search grounding](./Search_grounding_for_research_report.ipynb): Use search grounding to write a company research report with Gemini 1.5 Flash.

### Integrations

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"source": [
windmaple marked this conversation as resolved.
Show resolved Hide resolved
windmaple marked this conversation as resolved.
Show resolved Hide resolved
"<table align=\"left\">\n",
" <td>\n",
" <a target=\"_blank\" href=\"https://colab.research.google.com/github/google-gemini/cookbook/blob/main/examples/search_grounding_for_research_report.ipynb\"><img src=\"https://www.tensorflow.org/images/colab_logo_32px.png\" />Run in Google Colab</a>\n",
" <a target=\"_blank\" href=\"https://colab.research.google.com/github/google-gemini/cookbook/blob/main/examples/Search_grounding_for_research_report.ipynb\"><img src=\"https://www.tensorflow.org/images/colab_logo_32px.png\" />Run in Google Colab</a>\n",
" </td>\n",
"</table>"
]
Expand All @@ -61,7 +61,7 @@
"source": [
"In this tutorial you are going to leverage the [grounding-with-Google-Search](https://ai.google.dev/gemini-api/docs/grounding) capability of the Gemini 1.5 model to write a company report. Note that search grounding is a paid ony feature and this tutorial does not work with a free tier API key.\n",
"\n",
"You may be asking, why does one need to use the search tool for this purpose? Well, as you may be aware, today's business world evolves very fast and LLMs generally are not trained frequently enough to capture the latest updates. Luckily Google search comes to the rescue. Google search is built to provide accurate and nearly realtime information and can help us fulfill this task nicely.\n",
"You may be asking, why does one need to use search grounding for this purpose? Well, as you may be aware, today's business world evolves very fast and LLMs generally are not trained frequently enough to capture the latest updates. Luckily Google search comes to the rescue. Google search is built to provide accurate and nearly realtime information and can help us fulfill this task nicely.\n",
"\n",
"Note that the latest [search tool](https://ai.google.dev/gemini-api/docs/models/gemini-v2#search-tool) that comes with Gemini 2.0 is much easier to use and should be prioritized over search grounding in Gemini 1.5 models."
]
Expand Down Expand Up @@ -341,7 +341,7 @@
"\n",
"Next you define a couple of helper functions to better display the final report.\n",
"\n",
"Note that You must enable Google Search Suggestions, which help users find search results corresponding to a grounded response, and [display the search queries](https://ai.google.dev/gemini-api/docs/grounding/search-suggestions#display-requirements) that are included in the grounded response's metadata. You can find [more details](https://ai.google.dev/gemini-api/terms#grounding-with-google-search) about this requirement."
"Note that you must enable Google Search Suggestions, which help users find search results corresponding to a grounded response, and [display the search queries](https://ai.google.dev/gemini-api/docs/grounding/search-suggestions#display-requirements) that are included in the grounded response's metadata. You can find [more details](https://ai.google.dev/gemini-api/terms#grounding-with-google-search) about this requirement."
]
},
{
Expand Down Expand Up @@ -1149,7 +1149,9 @@
"id": "leOZmicAwTSn"
},
"source": [
"As you can see, the Gemini 1.5 model is able to write an accurate and well-structured research report for us. All the information in the report is factual and up-to-date."
"As you can see, the Gemini 1.5 model is able to write an accurate and well-structured research report for us. All the information in the report is factual and up-to-date.\n",
"\n",
"Note that while this works quite nicely, it still requires multiple steps for the job. With Gemini 2.0, it is much easier and you can accomplish the same with only a single step using the new [search tool](../gemini-2/search_tool_for_research_report.ipynb). "
]
},
{
Expand All @@ -1160,15 +1162,15 @@
"source": [
"## Next Steps\n",
"\n",
"* To learn more about search grounding, check out the [Grounding with Google Search](https://ai.google.dev/gemini-api/docs/grounding?lang=python) documentation\n",
"* To get started with search grounding, check out the [Search grounding quickstart](../quickstarts/Search_Grounding.ipynb).",
"* Also check the [Gemini 2.0 search tool](../gemini-2/search_tool.ipynb) notebook for a more recent example."
"* To learn more about search grounding, check out the [Grounding with Google Search](https://ai.google.dev/gemini-api/docs/grounding?lang=python) documentation.\n",
"* To get started with search grounding, check out the [Search grounding quickstart](../quickstarts/Search_Grounding.ipynb).\n",
"* Also check the [search tool for research report](../gemini-2/search_tool_for_research_report.ipynb) notebook for a more recent example using Gemini 2.0."
]
}
],
"metadata": {
"colab": {
"name": "search_grounding_for_research_report.ipynb",
"name": "Search_grounding_for_research_report.ipynb",
"toc_visible": true
},
"kernelspec": {
Expand Down
1 change: 1 addition & 0 deletions gemini-2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Explore Gemini 2.0’s capabilities through the following notebooks using Google
* [Live API tool use](./live_api_tool_use.ipynb) \- Overview of tool use in the Live API with the GenAI SDK
* [Plotting and mapping](./plotting_and_mapping.ipynb) \- Demo showing search, code and function calling with the Live API
* [Search tool](./search_tool.ipynb) \- Quick start using the Search tool with the unary and Live APIs in the GenAI SDK
* [Search tool for research report](./search_tool_for_research_report.ipynb) \- Demo showing generation of a research report using the search tool with the unary API in the GenAI SDK
* [Spatial understanding](./spatial_understanding.ipynb) \- Comprehensive overview of 2D spatial understanding capabilities with the GenAI SDK
* [Spatial understanding (3D)](./spatial_understanding_3d.ipynb) \- Comprehensive overview of 3D spatial understanding capabilities with the GenAI SDK
* [Video understanding](./video_understanding.ipynb) \- Comprehensive overview Gemini 2.0 video understanding capabilities with the GenAI SDK
Expand Down
Loading
Loading