-
Notifications
You must be signed in to change notification settings - Fork 2.7k
feat: Add a handwritten tool for Cloud Pub/Sub #3865
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
Conversation
Summary of ChangesHello @kamalaboulhosn, 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 integrates a new, handwritten toolset for Google Cloud Pub/Sub into the ADK framework. The primary goal is to provide more tailored and user-friendly tools for interacting with Pub/Sub topics and subscriptions, specifically addressing limitations found in auto-generated API tools, such as message encoding and subscription management. The changes include the core tool implementations, a dedicated configuration system, credential handling, and a fully functional sample agent with detailed usage instructions, making it easier for developers to leverage Pub/Sub within their ADK applications. Highlights
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
|
|
Note that the failing check-file-contents check is because this change imports from |
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.
Code Review
This pull request introduces a new handwritten toolset for Google Cloud Pub/Sub, complete with tools for publishing, pulling, and acknowledging messages. The changes include the core tool logic, configuration models, a comprehensive sample agent with a README, and a full suite of unit tests.
The implementation is well-structured, but I've identified a critical thread-safety issue in the client caching mechanism that could lead to race conditions. I've provided suggestions to add locking to resolve this. Additionally, I've pointed out a potential typo in the sample agent's model name and a small improvement for timestamp formatting in the tool's output.
Overall, this is a great addition, and with these fixes, it will be a robust and valuable tool.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
|
Hi @kamalaboulhosn , Thank you for your contribution! We appreciate you taking the time to submit this pull request. |
|
@ryanaiagent Looks like the test failures were unrelated to my change and fixed by 99f893a. I did an Update branch to pull that in, which triggered a re-run on the tests, and they are now passing. Thanks! |
|
Thank you @kamalaboulhosn for your contribution! 🎉 Your changes have been successfully imported and merged via Copybara in commit b6f6dcb. Closing this PR as the changes are now in the main branch. |
Please ensure you have read the contribution guide before creating a pull request.
Link to Issue or Description of Change
1. Link to an existing issue (if applicable):
2. Or, if no issue exists, describe the change:
N/A
Testing Plan
Added unit tests for all newly created classes, added a sample with an agent that depends on the new tool, tested that sample manually.
Unit Tests:
The warnings are because the tools have been marked experimental.
Manual End-to-End (E2E) Tests:
A sample agent has been provided in the PR. It can be run with
adk web. One can run commands like the following in it to see that it works:Checklist
Additional context
N/A