Skip to content
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 register action request/response #1769

Merged
merged 3 commits into from
Dec 17, 2023

Conversation

ylwu-amzn
Copy link
Collaborator

Description

Add register agent action request/response

Issues Resolved

[List any issues this PR will resolve]

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Commits are signed per the DCO using --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.

Signed-off-by: Yaliang Wu <ylwu@amazon.com>
Copy link

codecov bot commented Dec 17, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (4d8d32e) 82.53% compared to head (0335a8f) 82.69%.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1769      +/-   ##
============================================
+ Coverage     82.53%   82.69%   +0.16%     
- Complexity     4719     4745      +26     
============================================
  Files           459      462       +3     
  Lines         18881    18940      +59     
  Branches       1976     1976              
============================================
+ Hits          15583    15662      +79     
+ Misses         2471     2451      -20     
  Partials        827      827              
Flag Coverage Δ
ml-commons 82.69% <100.00%> (+0.16%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Yaliang Wu <ylwu@amazon.com>
for (MLToolSpec toolSpec : tools) {
String toolName = Optional.ofNullable(toolSpec.getName()).orElse(toolSpec.getType());
if (toolNames.contains(toolName)) {
throw new IllegalArgumentException("Tool has duplicate name or alias: " + toolName);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we cover this section in test?.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure

Signed-off-by: Yaliang Wu <ylwu@amazon.com>
for (MLToolSpec toolSpec : tools) {
String toolName = Optional.ofNullable(toolSpec.getName()).orElse(toolSpec.getType());
if (toolNames.contains(toolName)) {
throw new IllegalArgumentException("Duplicate tool defined: " + toolName);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it expected to throw this exception or just remove the redundancy in the tools and return normally?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it's expected, we can't remove redundancy for the user automatically as we don't know which one is the correct.

@ylwu-amzn ylwu-amzn merged commit 94c5d21 into opensearch-project:main Dec 17, 2023
8 of 14 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Dec 18, 2023
* add register action request/response

Signed-off-by: Yaliang Wu <ylwu@amazon.com>

* add ut for MLUndeployModelsResponse

Signed-off-by: Yaliang Wu <ylwu@amazon.com>

* add more ut

Signed-off-by: Yaliang Wu <ylwu@amazon.com>

---------

Signed-off-by: Yaliang Wu <ylwu@amazon.com>
(cherry picked from commit 94c5d21)
ylwu-amzn added a commit that referenced this pull request Dec 18, 2023
* add register action request/response

Signed-off-by: Yaliang Wu <ylwu@amazon.com>

* add ut for MLUndeployModelsResponse

Signed-off-by: Yaliang Wu <ylwu@amazon.com>

* add more ut

Signed-off-by: Yaliang Wu <ylwu@amazon.com>

---------

Signed-off-by: Yaliang Wu <ylwu@amazon.com>
(cherry picked from commit 94c5d21)

Co-authored-by: Yaliang Wu <ylwu@amazon.com>
jackiehanyang pushed a commit to jackiehanyang/ml-commons that referenced this pull request Dec 28, 2023
* add register action request/response

Signed-off-by: Yaliang Wu <ylwu@amazon.com>

* add ut for MLUndeployModelsResponse

Signed-off-by: Yaliang Wu <ylwu@amazon.com>

* add more ut

Signed-off-by: Yaliang Wu <ylwu@amazon.com>

---------

Signed-off-by: Yaliang Wu <ylwu@amazon.com>
austintlee pushed a commit to austintlee/ml-commons that referenced this pull request Feb 29, 2024
* add register action request/response

Signed-off-by: Yaliang Wu <ylwu@amazon.com>

* add ut for MLUndeployModelsResponse

Signed-off-by: Yaliang Wu <ylwu@amazon.com>

* add more ut

Signed-off-by: Yaliang Wu <ylwu@amazon.com>

---------

Signed-off-by: Yaliang Wu <ylwu@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants