fix: improve error message when beautifulsoup4/lxml not installed for load_web_page#4853
fix: improve error message when beautifulsoup4/lxml not installed for load_web_page#4853brucearctor wants to merge 1 commit intogoogle:mainfrom
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the user experience for the Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request improves the error handling in load_web_page for cases where optional dependencies are not installed. It wraps the imports of beautifulsoup4 and lxml in a try-except block. If an ImportError is raised, it is caught and a new ImportError is raised with a more informative message that instructs the user on how to install the required packages. The change is correct and improves the user experience by providing clear, actionable guidance.
|
Response from ADK Triaging Agent Hello @brucearctor, thank you for your contribution! Before we can merge this pull request, we need you to sign our Contributor License Agreement (CLA). You can do so by following the instructions in the "cla/google" check at the bottom of the pull request. This is a one-time process and is required for all contributions to Google open source projects. Thanks! |
… load_web_page The load_web_page tool requires beautifulsoup4 and lxml, which are available via the [extensions] optional dependency group. Previously, calling the tool without these packages installed produced a raw ModuleNotFoundError, giving no guidance on how to resolve it. This wraps the deferred imports in try/except to provide a clear, actionable error message directing users to install the missing packages with: pip install google-adk[extensions] Fixes google#4852
f1bc099 to
d3b4bd9
Compare
|
should now be sorted :-) |
Description
The built-in
load_web_pagetool requiresbeautifulsoup4andlxml, which are available via the[extensions]optional dependency group. When a user installsgoogle-adkwithout the[extensions]extra and callsload_web_page, they get a rawModuleNotFoundError: No module named 'bs4'with no guidance on how to resolve it.This change wraps the deferred imports in a
try/exceptto provide a clear, actionable error message:Fixes #4852