-
Notifications
You must be signed in to change notification settings - Fork 149
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
make memory optional in conversational agent #3626
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Jing Zhang <[email protected]>
) | ||
.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
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.