-
Notifications
You must be signed in to change notification settings - Fork 23
json-schema: add datasets url #123
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
json-schema: add datasets url #123
Conversation
Signed-off-by: caozhuozi <[email protected]>
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.
Summary of Changes
Hello @caozhuozi, 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 introduces a new "datasetsURL" field to the configuration JSON schema, aligning it with recent changes and addressing potential CI failures. The update ensures that dataset URLs are correctly validated as an array of strings, enhancing the robustness of configuration parsing.
Highlights
- JSON Schema Update: The config-schema.json file has been updated to include a new "datasetsURL" property within the "descriptor" object. This property is defined as an array of strings.
- Test Case Addition: A new test case has been added to config_test.go to validate the "datasetsURL" property. This test specifically checks for an expected failure when "datasetsURL" is not provided as an array, ensuring schema compliance.
Using Gemini Code Assist
The 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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.
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
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
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 updates the JSON schema to include datasetsURL and adds a corresponding test case. The changes are correct and align with the goal of the PR. I've provided a few suggestions to improve validation by adding a format specifier for the URL, enhance test coverage with a success case, and improve code style consistency in the new test.
| "items": { | ||
| "type": "string" | ||
| } |
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.
To improve validation, it's a good practice to specify the format for URL strings. Consider adding "format": "uri" to the string item definition. This will ensure that the values in the datasetsURL array are valid URIs. You might consider applying this to docURL and sourceURL as well in a separate change to improve consistency across all URL fields.
"items": {
"type": "string",
"format": "uri"
}| config: ` | ||
| { | ||
| "descriptor": { | ||
| "name": "xyz-3-8B-Instruct", | ||
| "version": "3.1", | ||
| "sourceURL": "https://github.com/xyz/xyz3", | ||
| "datasetsURL": "https://example.com/dataset" | ||
| }, | ||
| "config": { | ||
| "paramSize": "8b" | ||
| }, | ||
| "modelfs": { | ||
| "type": "layers", | ||
| "diffIds": [ | ||
| "sha256:1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef" | ||
| ] | ||
| } | ||
| } | ||
| `, |
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 JSON in this test case has inconsistent indentation. For better readability and to maintain a consistent style across the codebase, please format the JSON string with a standard 2-space indentation.
| config: ` | |
| { | |
| "descriptor": { | |
| "name": "xyz-3-8B-Instruct", | |
| "version": "3.1", | |
| "sourceURL": "https://github.com/xyz/xyz3", | |
| "datasetsURL": "https://example.com/dataset" | |
| }, | |
| "config": { | |
| "paramSize": "8b" | |
| }, | |
| "modelfs": { | |
| "type": "layers", | |
| "diffIds": [ | |
| "sha256:1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef" | |
| ] | |
| } | |
| } | |
| `, | |
| config: ` | |
| { | |
| "descriptor": { | |
| "name": "xyz-3-8B-Instruct", | |
| "version": "3.1", | |
| "sourceURL": "https://github.com/xyz/xyz3", | |
| "datasetsURL": "https://example.com/dataset" | |
| }, | |
| "config": { | |
| "paramSize": "8b" | |
| }, | |
| "modelfs": { | |
| "type": "layers", | |
| "diffIds": [ | |
| "sha256:1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef" | |
| ] | |
| } | |
| } | |
| `, |
| } | ||
| `, | ||
| fail: true, | ||
| }, |
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.
While this negative test case is great for ensuring type safety, it would be beneficial to also add a positive test case to verify that a valid datasetsURL (an array of strings) passes validation. This would make the tests for this new field more comprehensive.
You could add a test case like this after the current one:
// expected success: datasetsURL is an array
{
config: `
{
"descriptor": {
"name": "xyz-3-8B-Instruct",
"version": "3.1",
"sourceURL": "https://github.com/xyz/xyz3",
"datasetsURL": [
"https://example.com/dataset1",
"https://example.com/dataset2"
]
},
"config": {
"paramSize": "8b"
},
"modelfs": {
"type": "layers",
"diffIds": [
"sha256:1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"
]
}
}
`,
fail: false,
},
bergwolf
left a comment
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.
lgtm, thanks!
chlins
left a comment
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.
lgtm
Description
This change align the json schema with the change introcuded in #85, which should also fixes the ci failure.
Related Issue
Motivation and Context