-
Notifications
You must be signed in to change notification settings - Fork 183
FEATURE: Summarize the steps when max steps limit reached #4184
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Jiaru Jiang <jiaruj@amazon.com>
Signed-off-by: Jiaru Jiang <jiaruj@amazon.com>
… into max-step-summary
Do we plan to summarize the memory when it's too long? |
As far as I know, there’s no such plan. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4184 +/- ##
============================================
- Coverage 82.02% 82.01% -0.01%
- Complexity 9195 9206 +11
============================================
Files 789 789
Lines 39541 39597 +56
Branches 4387 4396 +9
============================================
+ Hits 32432 32475 +43
- Misses 5219 5224 +5
- Partials 1890 1898 +8
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:
|
Signed-off-by: Jiaru Jiang <jiaruj@amazon.com>
Signed-off-by: Jiaru Jiang <jiaruj@amazon.com>
… into max-step-summary
sendTraditionalMaxIterationsResponse( | ||
sessionId, | ||
listener, | ||
question, | ||
parentInteractionId, | ||
verbose, | ||
traceDisabled, | ||
traceTensors, | ||
conversationIndexMemory, | ||
traceNumber, | ||
additionalInfo, | ||
summaryThought, | ||
0, | ||
tools | ||
); | ||
}, e -> { log.warn("Failed to generate LLM summary", e); })); | ||
} else { | ||
sendTraditionalMaxIterationsResponse( | ||
sessionId, | ||
listener, | ||
question, | ||
parentInteractionId, | ||
verbose, | ||
traceDisabled, | ||
traceTensors, | ||
conversationIndexMemory, | ||
traceNumber, | ||
additionalInfo, | ||
lastThought, | ||
maxIterations, | ||
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.
in both places, we are using the same method? so can we just define the parameters that change and call the method once
String incompleteResponse; | ||
if (maxIterations == 0) { | ||
incompleteResponse = lastThought.get(); | ||
} else { | ||
incompleteResponse = (lastThought.get() != null && !lastThought.get().isEmpty() && !"null".equals(lastThought.get())) | ||
? String.format("%s. Last thought: %s", String.format(MAX_ITERATIONS_MESSAGE, maxIterations), lastThought.get()) | ||
: String.format(MAX_ITERATIONS_MESSAGE, maxIterations); | ||
} |
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.
is maxIterations here being used as a flag? I don't understand the need for this
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, maxIterations is used as a flag so we can reuse the sendTraditionalMaxIterationsResponse method.
ml-algorithms/src/main/java/org/opensearch/ml/engine/algorithms/agent/MLChatAgentRunner.java
Show resolved
Hide resolved
ml-algorithms/src/main/java/org/opensearch/ml/engine/algorithms/agent/MLChatAgentRunner.java
Show resolved
Hide resolved
Signed-off-by: Jiaru Jiang <jiaruj@amazon.com>
Signed-off-by: Jiaru Jiang <jiaruj@amazon.com>
Signed-off-by: Jiaru Jiang <jiaruj@amazon.com>
Signed-off-by: Jiaru Jiang <jiaruj@amazon.com>
Description
This feature provides intelligent summarization when ML Commons Chat Agents reach their maximum iteration limit without completing tasks.
Key Components:
Trigger Mechanism: Activates when agent execution reaches the
max_iteration
parameter limitControl Parameter:
summarize_when_max_iteration
(boolean, default: false) enables/disables the featureRelated Issues
#4150
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.