feat: Add message creation methods with contextId and taskId support#322
feat: Add message creation methods with contextId and taskId support#322fjuma merged 3 commits intoa2aproject:mainfrom
Conversation
Summary of ChangesHello @Asymtode712, 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 enhances the message creation capabilities within the A2A Java SDK. It introduces new, more configurable methods for creating user and agent messages, allowing developers to specify additional attributes like context and task identifiers, custom message parts, and metadata. This update aims to provide a more robust and consistent API experience, mirroring the functionality available in the Python SDK, and is backed by thorough unit tests to ensure reliability. 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.
Code Review
This pull request introduces new factory methods in A2A.java for creating Message objects with extended options like contextId, taskId, and custom parts. The changes are well-structured and follow the existing pattern of the class. Comprehensive unit tests have been added in A2ATest.java to cover the new functionality. My review includes a couple of suggestions for code simplification and improving documentation clarity in the new createMessage method.
fjuma
left a comment
There was a problem hiding this comment.
@Asymtode712 Thanks for the PR! I've added some comments on it. Feel free to let us know if you have any questions.
|
@fjuma done with the changes, pls review |
…2aproject#322) ## PR Description - Added new message creation methods to A2A.java (createUserMessage, createAgentMessage, createMessage) - Implemented support for configuring contextId, taskId, parts, metadata, and referenceTaskIds - Added comprehensive test cases in A2ATest.java to verify functionality - Methods follow similar pattern to the Python implementation for consistency across SDKs - [x] Follow the [`CONTRIBUTING` Guide](../CONTRIBUTING.md). - [x] Ensure the tests pass Fixes a2aproject#302 🦕
PR Description
Added new message creation methods to A2A.java (createUserMessage, createAgentMessage, createMessage)
Implemented support for configuring contextId, taskId, parts, metadata, and referenceTaskIds
Added comprehensive test cases in A2ATest.java to verify functionality
Methods follow similar pattern to the Python implementation for consistency across SDKs
Follow the
CONTRIBUTINGGuide.Ensure the tests pass
Fixes #302 🦕