-
Notifications
You must be signed in to change notification settings - Fork 259
feat(skill): add zip skill parsing util #694
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
base: main
Are you sure you want to change the base?
feat(skill): add zip skill parsing util #694
Conversation
Summary of ChangesHello @fang-tech, 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 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 introduces a useful feature for parsing agent skills from zip archives. The implementation includes overloads for handling byte arrays, paths, and input streams, which is good for flexibility. The accompanying tests are well-structured and cover various success and failure scenarios, ensuring the new functionality is robust.
My review focuses on a few areas for improvement:
- Memory Efficiency: The current implementation for handling zip files reads the entire zip file and then each of its entries into memory. This could lead to
OutOfMemoryErrorwith large skill packages. I've provided suggestions to improve this by using streams. toString()Implementation: I've suggested an improvement to the newtoString()method inAgentSkillto make it more informative and safer by not logging potentially large content.
Overall, this is a solid contribution. Addressing the memory concerns will make it even better.
agentscope-core/src/main/java/io/agentscope/core/skill/util/SkillUtil.java
Outdated
Show resolved
Hide resolved
agentscope-core/src/main/java/io/agentscope/core/skill/util/SkillUtil.java
Outdated
Show resolved
Hide resolved
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.
Pull request overview
Adds support for creating AgentSkill instances from a zipped “skill package” (containing SKILL.md plus optional resource files), along with expanded unit test coverage for markdown parsing and the new zip-based loading APIs.
Changes:
- Added
SkillUtil.createFromZip(...)overloads to load skills frombyte[],Path, orInputStream. - Expanded
SkillUtilTestto organize markdown tests and add comprehensive zip package tests. - Added
AgentSkill.toString()implementation.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| agentscope-core/src/main/java/io/agentscope/core/skill/util/SkillUtil.java | Introduces zip package parsing APIs and supporting helpers. |
| agentscope-core/src/test/java/io/agentscope/core/skill/SkillUtilTest.java | Adds/organizes tests for markdown parsing and new zip parsing behaviors. |
| agentscope-core/src/main/java/io/agentscope/core/skill/AgentSkill.java | Adds a toString() implementation for easier debugging/logging. |
agentscope-core/src/main/java/io/agentscope/core/skill/AgentSkill.java
Outdated
Show resolved
Hide resolved
agentscope-core/src/main/java/io/agentscope/core/skill/AgentSkill.java
Outdated
Show resolved
Hide resolved
agentscope-core/src/main/java/io/agentscope/core/skill/util/SkillUtil.java
Outdated
Show resolved
Hide resolved
agentscope-core/src/main/java/io/agentscope/core/skill/util/SkillUtil.java
Outdated
Show resolved
Hide resolved
agentscope-core/src/main/java/io/agentscope/core/skill/util/SkillUtil.java
Show resolved
Hide resolved
agentscope-core/src/main/java/io/agentscope/core/skill/util/SkillUtil.java
Show resolved
Hide resolved
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
AgentScope-Java Version
[The version of AgentScope-Java you are working on, e.g. 1.0.8, check your pom.xml dependency version or run
mvn dependency:tree | grep agentscope-parent:pom(only mac/linux)]Description
[Please describe the background, purpose, changes made, and how to test this PR]
Checklist
Please check the following items before code is ready to be reviewed.
mvn spotless:applymvn test)