-
Notifications
You must be signed in to change notification settings - Fork 162
make memory optional in conversational agent #3626
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
) | ||
.build() | ||
); | ||
if (!StringUtils.isEmpty(sessionId)) { |
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.
let's inverse this? if (StringUtils.isEmpty()) { return emptyList; }
List<ModelTensors> traceTensors = (conversationIndexMemory == null) | ||
? new ArrayList<>() | ||
: createModelTensors(sessionId, parentInteractionId); |
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.
what about passing conversationIndexMemory to this method and returning empty list rather than using ternary operator here?
*ignore, seems like it will affect a lot of other methods using this
@@ -121,12 +122,17 @@ public MLChatAgentRunner( | |||
|
|||
@Override | |||
public void run(MLAgent mlAgent, Map<String, String> params, ActionListener<Object> listener) { | |||
String memoryType = mlAgent.getMemory().getType(); | |||
String memoryType = mlAgent.getMemory() == null ? null : mlAgent.getMemory().getType(); |
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.
does the current behavior throw NPE here? wondering if there is some validation in the REST/Transport layer to check for memory, didn't see any tho
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.
Memory is created by default in MLAgentExecutor right? so should we change some code there as well
d2aa325
to
832dfb9
Compare
Signed-off-by: Jing Zhang <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3626 +/- ##
============================================
+ Coverage 80.28% 80.39% +0.11%
- Complexity 7821 7913 +92
============================================
Files 683 693 +10
Lines 34519 34847 +328
Branches 3840 3875 +35
============================================
+ Hits 27714 28016 +302
+ Misses 5099 5097 -2
- Partials 1706 1734 +28
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:
|
Description
Related Issues
#3614
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.