Conversation
Summary of ChangesHello @Stewitch, 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 significantly overhauls the logging infrastructure within the 'bot_sdk' package, transitioning to a more robust and developer-friendly 'loguru'-based system. The primary goal is to provide clearer, more organized log output for both the SDK's internal operations and individual bot instances. This change not only improves debugging and monitoring capabilities but also enhances code readability and maintainability across the codebase, particularly in the Zulip integration and bot examples. 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
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 significantly improves the logging system by introducing structured, per-bot logging with loguru, which is a great enhancement for debuggability and monitoring. The dependency injection of a bot-specific logger into BaseBot is a solid design choice that will make bot development cleaner. The documentation updates are also clear and helpful.
I've found a couple of minor issues:
- A potential
AttributeErrorin the newbot_sdk/log.pydue to an undefined name in__all__. ruff, a development tool, has been added as a runtime dependency.
Overall, this is a very strong pull request that greatly improves the SDK's foundation. Well done!
| "ruamel-yaml>=0.19.1", | ||
| "rich>=14.2.0", | ||
| "prompt-toolkit>=3.0.52", | ||
| "ruff>=0.15.0", |
There was a problem hiding this comment.
ruff is a linter and formatter, which is typically a development dependency, not a runtime dependency for an SDK. Including it in the main dependencies list will install it for all users of this SDK, which is likely not intended. It would be better to move it to a development dependency group, for example, under [project.optional-dependencies].
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This pull request introduces several improvements to logging practices and code readability in the
bot_sdkpackage, especially in the Zulip integration and documentation. The main changes include switching to structured logging usingloguru, updating documentation examples to use the new logging approach, and reformatting code for better clarity and maintainability.Logging improvements:
loggingmodule tologuruinbot_sdk/async_zulip.py, updating all logger usage accordingly.README.mdandREADME.zh-CN.md, replacingprintstatements withself.logger.infoandself.logger.debug. [1] [2] [3] [4]bot_sdk/__init__.pyto includeget_bot_loggerfrom the newlogmodule. [1] [2]Documentation updates:
Code formatting and maintainability:
bot_sdk/async_zulip.py. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14]