-
Notifications
You must be signed in to change notification settings - Fork 143
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
bug fix - tool parameters missing #1911
Conversation
Signed-off-by: Jing Zhang <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1911 +/- ##
============================================
+ Coverage 82.94% 82.95% +0.01%
- Complexity 5414 5415 +1
============================================
Files 521 521
Lines 21709 21710 +1
Branches 2213 2213
============================================
+ Hits 18007 18010 +3
+ Misses 2807 2804 -3
- Partials 895 896 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
ml-algorithms/src/main/java/org/opensearch/ml/engine/algorithms/agent/MLChatAgentRunner.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Jing Zhang <[email protected]>
// Verify the size of parameters passed in the tool run method. | ||
ArgumentCaptor argumentCaptor = ArgumentCaptor.forClass(Map.class); | ||
verify(firstTool).run((Map<String, String>) argumentCaptor.capture(), any()); | ||
assertEquals(3, ((Map) argumentCaptor.getValue()).size()); |
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 map of argument is expecting size of 3, should match?
Map<String, String> params = new HashMap<>();
params.put("action", action);
params.put("action_input", actionInput);
params.put(FIRST_TOOL, someInput);
@@ -465,7 +465,7 @@ private void runReAct( | |||
action = toolName; | |||
|
|||
if (tools.containsKey(action) && inputTools.contains(action)) { | |||
Map<String, String> toolParams = new HashMap<>(); | |||
Map<String, String> toolParams = new HashMap<>(toolSpecMap.get(action).getParameters()); | |||
toolParams.put("input", actionInput); |
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.
should we add a case for input will not be override?
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.
Yes, let me add one more case in next pr.
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.x 2.x
# Navigate to the new working tree
cd .worktrees/backport-2.x
# Create a new branch
git switch --create backport/backport-1911-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 a5c500cc8cb4826ea7ca819107da5bb940c82ff7
# Push it to GitHub
git push --set-upstream origin backport/backport-1911-to-2.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.x Then, create a pull request where the |
* bug fix - tool parameters missing Signed-off-by: Jing Zhang <[email protected]> * address comments Signed-off-by: Jing Zhang <[email protected]> --------- Signed-off-by: Jing Zhang <[email protected]>
* bug fix - tool parameters missing Signed-off-by: Jing Zhang <[email protected]> * address comments Signed-off-by: Jing Zhang <[email protected]> --------- Signed-off-by: Jing Zhang <[email protected]>
* bug fix - tool parameters missing * address comments --------- Signed-off-by: Jing Zhang <[email protected]>
* bug fix - tool parameters missing Signed-off-by: Jing Zhang <[email protected]> * address comments Signed-off-by: Jing Zhang <[email protected]> --------- Signed-off-by: Jing Zhang <[email protected]> (cherry picked from commit a5c500c)
* bug fix - tool parameters missing Signed-off-by: Jing Zhang <[email protected]> * address comments Signed-off-by: Jing Zhang <[email protected]> --------- Signed-off-by: Jing Zhang <[email protected]> (cherry picked from commit a5c500c) Co-authored-by: Jing Zhang <[email protected]>
* bug fix - tool parameters missing Signed-off-by: Jing Zhang <[email protected]> * address comments Signed-off-by: Jing Zhang <[email protected]> --------- Signed-off-by: Jing Zhang <[email protected]>
Description
The tool's parameters configured in agent registration are missing when conversational agent runs the tool.
Tested in my local environment.
Issues Resolved
[List any issues this PR will resolve]
Check List
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.