-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
fix: Add Google Search example to MM Live API Notebook #1652
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi team,
I'm currently reviewing this pull request and will provide feedback shortly. In the meantime, here's a summary for you and other reviewers to quickly get up to speed:
This pull request, authored by holtskinner, aims to add a Google Search example to the Multimodal Live API Notebook within the generative-ai
repository. The changes are focused on the Jupyter Notebook file gemini/multimodal-live-api/intro_multimodal_live_api_genai_sdk.ipynb
.
Here's a breakdown of the modifications:
- Added Google Search to API capabilities: A new bullet point "Google Search" was added to the list of Multimodal Live API capabilities (line 109).
- Updated import statements: The
GoogleSearch
import was added to the notebook (line 193). - Added a new code example (Example 6): A complete new code example demonstrating how to use the
google_search
tool was added to the notebook (lines 579-624). This example shows how to configure theLiveConnectConfig
to include theGoogleSearch
tool and then use it to query information. - Updated execution counts: The execution counts in several code cells were updated to reflect the changes (lines 181, 219, 234, 256).
The changes are straightforward and well-documented within the notebook itself. The addition of a Google Search example significantly enhances the notebook's practical value.
Short poem for your enjoyment:
Code flows like a river,
Adding features, ever bright,
Search now finds its place.
Looking forward to discussing this further!
Best,
Gemini/code-review-assist
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This pull request adds a Google Search example to the Multimodal Live API Notebook. This is a valuable addition that enhances the notebook's comprehensiveness and provides users with a practical example of how to use the google_search
tool. The changes are well-implemented and the code is clear. I have a few minor suggestions to further improve the clarity and consistency of the code.
I've referenced the following from the provided style guides:
- Google Python Style Guide: For general Python code style and best practices.
- Google JavaScript Style Guide: For JavaScript code style and best practices.
- Google Java Style Guide: For Java code style and best practices.
- Google C# Style Guide: For C# code style and best practices.
- Google C++ Style Guide: For C++ code style and best practices.
- Google Go Style Guide: For Go code style and best practices.
- Google TypeScript Style Guide: For TypeScript code style and best practices.
- Google Kotlin Style Guide: For Kotlin code style and best practices.
- Google Markdown Style Guide: For Markdown style and best practices.
@@ -106,6 +106,7 @@ | |||
"- Text-to-audio conversation\n", | |||
"- Function calling\n", | |||
"- Code execution\n", | |||
"- Google Search\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider adding a brief explanation of what the Google Search tool does in this overview. For example, you could add a sentence like "The Google Search tool allows the model to access and process real-time information from the web."
"- Google Search\n", | |
- Google Search\nThe `google_search` tool allows the model to access and process real-time information from the web. |
"### **Example 6**: Google Search\n", | ||
"\n", | ||
"The `google_search` tool lets the model conduct Google searches. For example, try asking it about events that are too recent to be in the training data.\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The example query in this section could be more specific. Instead of asking about a general earthquake, consider asking about a specific event or aspect related to a recent earthquake. This would better demonstrate the tool's ability to retrieve real-time information. For example, you could ask "What were the initial reported damages from the earthquake?" or "Were there any aftershocks reported following the main earthquake?"
"### **Example 6**: Google Search\n", | |
"\n", | |
"The `google_search` tool lets the model conduct Google searches. For example, try asking it about events that are too recent to be in the training data.\n" | |
### **Example 6**: Google Search | |
The `google_search` tool lets the model conduct Google searches. For example, try asking it about specific details related to a recent event, like an earthquake, that are too recent to be in the training data. |
" config=config,\n", | ||
") as session:\n", | ||
" text_input = (\n", | ||
" \"Tell me about the largest earthquake in California the week of Dec 5 2024?\"\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As mentioned in the previous comment, consider making the example query more specific. For instance, instead of asking about the largest earthquake in general, try asking about a specific detail, such as the magnitude or the epicenter of the earthquake. This would better illustrate the tool's ability to retrieve precise information. For example, you could ask "What was the magnitude and epicenter of the largest earthquake in California during the week of December 5, 2024?"
" \"Tell me about the largest earthquake in California the week of Dec 5 2024?\"\n", | |
"What was the magnitude and epicenter of the largest earthquake in California during the week of December 5, 2024?" |
No description provided.