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

enhance: make response_field customizable in MLModelTool #2007

Merged
merged 3 commits into from
Feb 7, 2024

Conversation

zhichao-aws
Copy link
Member

Description

Current MLModelTool hard code to fetch the response field from response body. However, in other non-LLM cases or non-Claude LLM services, we can not assume all of them use response keyword.

This PR makes response_field customizable in MLModelTool. If not provided, it will use response by default. This will make current API invokation behavior consistent.

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.

Copy link

codecov bot commented Feb 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (b84b130) 82.57% compared to head (1ae4506) 82.56%.
Report is 15 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #2007      +/-   ##
============================================
- Coverage     82.57%   82.56%   -0.02%     
+ Complexity     5577     5575       -2     
============================================
  Files           540      540              
  Lines         22453    22456       +3     
  Branches       2286     2286              
============================================
  Hits          18540    18540              
- Misses         2981     2985       +4     
+ Partials        932      931       -1     
Flag Coverage Δ
ml-commons 82.56% <100.00%> (-0.02%) ⬇️

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.

@zhichao-aws
Copy link
Member Author

@ylwu-amzn @dhrubo-os Do you think this PR is enough to fix this problem? Please help review thanks

@zhichao-aws zhichao-aws temporarily deployed to ml-commons-cicd-env February 7, 2024 03:25 — with GitHub Actions Inactive
@zhichao-aws zhichao-aws temporarily deployed to ml-commons-cicd-env February 7, 2024 03:25 — with GitHub Actions Inactive
@zhichao-aws zhichao-aws temporarily deployed to ml-commons-cicd-env February 7, 2024 03:25 — with GitHub Actions Inactive
@zhichao-aws zhichao-aws temporarily deployed to ml-commons-cicd-env February 7, 2024 03:25 — with GitHub Actions Inactive
@zhichao-aws zhichao-aws temporarily deployed to ml-commons-cicd-env February 7, 2024 03:25 — with GitHub Actions Inactive
@zhichao-aws zhichao-aws temporarily deployed to ml-commons-cicd-env February 7, 2024 03:25 — with GitHub Actions Inactive
@zhichao-aws zhichao-aws temporarily deployed to ml-commons-cicd-env February 7, 2024 03:25 — with GitHub Actions Inactive
@zhichao-aws zhichao-aws temporarily deployed to ml-commons-cicd-env February 7, 2024 03:25 — with GitHub Actions Inactive
@zhichao-aws zhichao-aws temporarily deployed to ml-commons-cicd-env February 7, 2024 07:43 — with GitHub Actions Inactive
@zhichao-aws zhichao-aws temporarily deployed to ml-commons-cicd-env February 7, 2024 07:43 — with GitHub Actions Inactive
@zhichao-aws zhichao-aws temporarily deployed to ml-commons-cicd-env February 7, 2024 07:43 — with GitHub Actions Inactive
@zhichao-aws zhichao-aws temporarily deployed to ml-commons-cicd-env February 7, 2024 07:43 — with GitHub Actions Inactive
@zhichao-aws zhichao-aws temporarily deployed to ml-commons-cicd-env February 7, 2024 07:43 — with GitHub Actions Inactive
@zhichao-aws zhichao-aws temporarily deployed to ml-commons-cicd-env February 7, 2024 07:43 — with GitHub Actions Inactive
@zhichao-aws zhichao-aws temporarily deployed to ml-commons-cicd-env February 7, 2024 08:12 — with GitHub Actions Inactive
@zhichao-aws zhichao-aws temporarily deployed to ml-commons-cicd-env February 7, 2024 08:12 — with GitHub Actions Inactive
@zhichao-aws zhichao-aws temporarily deployed to ml-commons-cicd-env February 7, 2024 08:12 — with GitHub Actions Inactive
@ylwu-amzn ylwu-amzn merged commit e1d21ba into opensearch-project:main Feb 7, 2024
13 of 14 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Feb 7, 2024
* enhance: make response_field customizable in MLModelTool

Signed-off-by: zhichao-aws <[email protected]>

* ut for malformed response field

Signed-off-by: zhichao-aws <[email protected]>

* remove import * in MLModelToolTests

Signed-off-by: zhichao-aws <[email protected]>

---------

Signed-off-by: zhichao-aws <[email protected]>
(cherry picked from commit e1d21ba)
opensearch-trigger-bot bot pushed a commit that referenced this pull request Feb 7, 2024
* enhance: make response_field customizable in MLModelTool

Signed-off-by: zhichao-aws <[email protected]>

* ut for malformed response field

Signed-off-by: zhichao-aws <[email protected]>

* remove import * in MLModelToolTests

Signed-off-by: zhichao-aws <[email protected]>

---------

Signed-off-by: zhichao-aws <[email protected]>
(cherry picked from commit e1d21ba)
ylwu-amzn pushed a commit that referenced this pull request Feb 7, 2024
* enhance: make response_field customizable in MLModelTool

Signed-off-by: zhichao-aws <[email protected]>

* ut for malformed response field

Signed-off-by: zhichao-aws <[email protected]>

* remove import * in MLModelToolTests

Signed-off-by: zhichao-aws <[email protected]>

---------

Signed-off-by: zhichao-aws <[email protected]>
(cherry picked from commit e1d21ba)

Co-authored-by: zhichao-aws <[email protected]>
ylwu-amzn pushed a commit that referenced this pull request Feb 7, 2024
* enhance: make response_field customizable in MLModelTool

Signed-off-by: zhichao-aws <[email protected]>

* ut for malformed response field

Signed-off-by: zhichao-aws <[email protected]>

* remove import * in MLModelToolTests

Signed-off-by: zhichao-aws <[email protected]>

---------

Signed-off-by: zhichao-aws <[email protected]>
(cherry picked from commit e1d21ba)

Co-authored-by: zhichao-aws <[email protected]>
austintlee pushed a commit to austintlee/ml-commons that referenced this pull request Mar 19, 2024
…project#2007)

* enhance: make response_field customizable in MLModelTool

Signed-off-by: zhichao-aws <[email protected]>

* ut for malformed response field

Signed-off-by: zhichao-aws <[email protected]>

* remove import * in MLModelToolTests

Signed-off-by: zhichao-aws <[email protected]>

---------

Signed-off-by: zhichao-aws <[email protected]>
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