-
Notifications
You must be signed in to change notification settings - Fork 33
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
Add model related field for tools #491
Add model related field for tools #491
Conversation
Signed-off-by: xinyual <[email protected]>
Signed-off-by: xinyual <[email protected]>
// the type of this tool | ||
public static final String TYPE = "CreateAnomalyDetectorTool"; | ||
|
||
public static final String MODEL_ID_FIELD = "model_id"; |
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.
Can we use this static variable to replace "model_id"
constant in factory?
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.
I see this constant been used in multiple classes, let's create a common constant class, eg. CommonConstants
to put it there, and that class can be used to put more global constants in the future.
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.
I see this constant been used in multiple classes, let's create a common constant class, eg.
CommonConstants
to put it there, and that class can be used to put more global constants in the future.
I think each tool should have its own related tool field so we cannot use a generate one for all tools
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.
Not quite understand, I mean this constant:
https://github.com/opensearch-project/skills/pull/491/files#diff-e7cc44d1e3c01541c76a3d3f5308487536871c349b84cf388baa9fb8c45a15a6R74 and
https://github.com/opensearch-project/skills/pull/491/files#diff-cacec66258e0f1410446a7f762a38af26fb9d2874e562151820f0d0e55f95f89R36 and
https://github.com/opensearch-project/skills/pull/491/files#diff-fa8cc057d2cd63132a2728fabab484d8b9b254faab603f50c189e50e12882d18R72
I see they're all string with value model_id
, this can be placed to a common place. This is not a big change and if you think you can optimize this in future PRs, I'm fine to approve.
It seems we have a compile error. Please fix it before merge.
|
Signed-off-by: xinyual <[email protected]>
Signed-off-by: xinyual <[email protected]>
Signed-off-by: xinyual <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #491 +/- ##
============================================
+ Coverage 81.78% 81.90% +0.11%
- Complexity 193 335 +142
============================================
Files 11 17 +6
Lines 961 1586 +625
Branches 137 222 +85
============================================
+ Hits 786 1299 +513
- Misses 121 201 +80
- Partials 54 86 +32 ☔ View full report in Codecov by Sentry. |
Signed-off-by: xinyual <[email protected]>
Signed-off-by: xinyual <[email protected]>
Signed-off-by: xinyual <[email protected]>
* add related model fields list Signed-off-by: xinyual <[email protected]> * apply spotless Signed-off-by: xinyual <[email protected]> * fix compile error Signed-off-by: xinyual <[email protected]> * use static parameter Signed-off-by: xinyual <[email protected]> * apply spotless Signed-off-by: xinyual <[email protected]> * create a common constant for common model id Signed-off-by: xinyual <[email protected]> * fix error Signed-off-by: xinyual <[email protected]> * fix UT error Signed-off-by: xinyual <[email protected]> --------- Signed-off-by: xinyual <[email protected]> (cherry picked from commit a2f9e2c) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* add related model fields list * apply spotless * fix compile error * use static parameter * apply spotless * create a common constant for common model id * fix error * fix UT error --------- (cherry picked from commit a2f9e2c) Signed-off-by: xinyual <[email protected]> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Description
To check downstream task before deleting, we need to add list of model related fields for model related tools. The background PR is: opensearch-project/ml-commons#3209
Related Issues
Resolves #[Issue number to be closed when this PR is merged]
Check List
--signoff
.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.