fix(werewolf): update vote message metadata structure#625
fix(werewolf): update vote message metadata structure#625AlbumenJ merged 1 commit intoagentscope-ai:mainfrom
Conversation
Change-Id: Ide4d61f04c034f90b891f3f003819af7065e448e
Summary of ChangesHello @LearningGp, 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 refactors the internal metadata structure of vote messages within the AgentScope Werewolf game example. The primary goal is to standardize the storage of structured output, specifically for player votes, by encapsulating relevant details like the target player and reason under a dedicated 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 correctly updates the metadata structure for vote messages in the Werewolf game example. By wrapping the vote data within MessageMetadataKeys.STRUCTURED_OUTPUT, it aligns the manual message creation for human players with the framework's standard for structured data, fixing a bug where getStructuredData would fail.
I've added a couple of suggestions to further improve maintainability by using the VoteModel class directly when constructing the vote message metadata. This would enhance type safety and consistency with how AI-generated votes are handled. These are non-blocking suggestions for future improvement.
...xamples/werewolf-hitl/src/main/java/io/agentscope/examples/werewolf/web/WerewolfWebGame.java
Show resolved
Hide resolved
...xamples/werewolf-hitl/src/main/java/io/agentscope/examples/werewolf/web/WerewolfWebGame.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull request overview
This PR updates the human vote message metadata in the HITL Werewolf example to use the standardized structured-output metadata key, aligning it with the core structured data APIs and fixing how human votes are parsed and counted.
Changes:
- Import
MessageMetadataKeysintoWerewolfWebGame. - Wrap human vote metadata for werewolf night voting under
MessageMetadataKeys.STRUCTURED_OUTPUTas a nested map containingtargetPlayerandreason. - Apply the same structured-output metadata pattern to human votes in the daytime voting phase.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
) ## AgentScope-Java Version 1.0.8 ## Description fix(werewolf): update vote message metadata structure ## Checklist Please check the following items before code is ready to be reviewed. - [x] Code has been formatted with `mvn spotless:apply` - [x] All tests are passing (`mvn test`) - [x] Javadoc comments are complete and follow project conventions - [x] Related documentation has been updated (e.g. links, examples, etc.) - [x] Code is ready for review
AgentScope-Java Version
1.0.8
Description
fix(werewolf): update vote message metadata structure
Checklist
Please check the following items before code is ready to be reviewed.
mvn spotless:applymvn test)