-
Notifications
You must be signed in to change notification settings - Fork 186
Ensure chat agent returns response when max iterations are reached #4031
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
Ensure chat agent returns response when max iterations are reached #4031
Conversation
Signed-off-by: Pavan Yekbote <pybot@amazon.com>
Signed-off-by: Pavan Yekbote <pybot@amazon.com>
Signed-off-by: Pavan Yekbote <pybot@amazon.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4031 +/- ##
=========================================
Coverage 80.64% 80.64%
- Complexity 8016 8025 +9
=========================================
Files 695 695
Lines 35023 35058 +35
Branches 3935 3942 +7
=========================================
+ Hits 28244 28274 +30
- Misses 5044 5047 +3
- Partials 1735 1737 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| public static final String DATETIME_FORMAT_FIELD = "datetime_format"; | ||
| public static final String SYSTEM_PROMPT_FIELD = "system_prompt"; | ||
|
|
||
| private static final String DEFAULT_MAX_ITERATIONS = "10"; |
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 customer configure this value?
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, chat agent has a parameter max_iteration
jiapingzeng
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.
Thanks for the quick fix!
ml-algorithms/src/main/java/org/opensearch/ml/engine/algorithms/agent/MLChatAgentRunner.java
Outdated
Show resolved
Hide resolved
ml-algorithms/src/main/java/org/opensearch/ml/engine/algorithms/agent/MLChatAgentRunner.java
Show resolved
Hide resolved
rithin-pullela-aws
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
Signed-off-by: Pavan Yekbote <pybot@amazon.com>
|
Can a maintainer please add backport label for 3.1? Thanks! |
|
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-3.1 3.1
# Navigate to the new working tree
cd .worktrees/backport-3.1
# Create a new branch
git switch --create backport/backport-4031-to-3.1
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 f6a68bf2ffca0b68c0c677a0aca9125e42f13a46
# Push it to GitHub
git push --set-upstream origin backport/backport-4031-to-3.1
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-3.1Then, create a pull request where the |
…pensearch-project#4031) * fix: mlchatagentrunner max iterations bug Signed-off-by: Pavan Yekbote <pybot@amazon.com> * fix: gradle spotless Signed-off-by: Pavan Yekbote <pybot@amazon.com> * feat: refactor some code and add test cases Signed-off-by: Pavan Yekbote <pybot@amazon.com> * refactor: move the last iteration check earlier Signed-off-by: Pavan Yekbote <pybot@amazon.com> --------- Signed-off-by: Pavan Yekbote <pybot@amazon.com> Co-authored-by: Dhrubo Saha <dhrubo@amazon.com>
|
Raised manual backport PR: #4036 |
Description
Ensures that chat agent returns a response when max iterations are reached. Currently, it returns an empty response when max_iteration is even and no response (api times out) if max_iteration is odd. This PR resolves that issue.
Related Issues
Resolves #4011
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.