-
Notifications
You must be signed in to change notification settings - Fork 110
chore: Update resubscribe and sendMessage without consumers will use … #528
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
chore: Update resubscribe and sendMessage without consumers will use … #528
Conversation
Summary of ChangesHello @jmesnil, 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 streamlines the client-side API for sending messages and resubscribing to event streams. The primary goal is to ensure that default consumer lists and streaming error handlers, configured at the client level, are automatically applied when these operations are invoked without explicit overrides. This change simplifies the API's usage and improves code maintainability by centralizing handler validation and application. Additionally, the introduction of nullability annotations ( 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
|
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 is a nice refactoring that simplifies the client API. By making the sendMessage and resubscribe methods use the client's configured consumers and error handler by default, you've reduced complexity and removed the need for null-checks and fallbacks deeper in the call stack. The restructuring of abstract and concrete methods in AbstractClient is a good design improvement. The consistent addition of @NonNull and @Nullable annotations clarifies the API contract, and the new test case for resubscribe is a valuable addition. I have one minor suggestion regarding Javadoc consistency to further improve clarity.
| * used if the streaming approach is used | ||
| * @param metadata the optional metadata to include when sending the message | ||
| * @param context optional client call context for the request (may be {@code null}) | ||
| * @param context optional client call context for the request |
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 Javadoc for the @Nullable parameter context has been updated to remove the (may be {@code null}) clarification. While the @Nullable annotation is present, explicitly mentioning nullability in the Javadoc is a good practice for clarity, especially for developers whose tools might not display nullability annotations. This same issue is present for other updated method signatures in this file (e.g., resubscribe). Consider re-adding this clarification for consistency and improved readability.
| * @param context optional client call context for the request | |
| * @param context optional client call context for the request (may be {@code null}) |
…the client's consumers and its streamingErrorHandler The code was already doing that down the path but this simplifies the code as the consumers and streamingErrorhandler can be validated from the top of the API Add a bunch of @nullable & @nonnull to clarify the API contract This fixes a2aproject#526 Signed-off-by: Jeff Mesnil <jmesnil@ibm.com>
a6d3664 to
23f1f89
Compare
|
/gemini review |
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 refactors the AbstractClient and Client classes to streamline the handling of consumers and streaming error handlers. The changes simplify the API by ensuring that sendMessage and resubscribe methods without explicit consumer or error handler parameters correctly utilize the client's default configured ones. The introduction of @NonNull and @Nullable annotations significantly clarifies the API contract, improving code readability and maintainability. A new test case has been added to validate the updated resubscription behavior, which is a good practice.
a2aproject#528) …the client's consumers and its streamingErrorHandler The code was already doing that down the path but this simplifies the code as the consumers and streamingErrorhandler can be validated from the top of the API Add a bunch of @nullable & @nonnull to clarify the API contract This fixes a2aproject#526 Signed-off-by: Jeff Mesnil <jmesnil@ibm.com>
…the client's consumers
and its streamingErrorHandler
The code was already doing that down the path but this simplifies the code as the consumers and streamingErrorhandler can be validated from the top of the API
Add a bunch of @nullable & @nonnull to clarify the API contract
This fixes #526