From c87fc8a4119cfedbb643f8c35027f182951a2121 Mon Sep 17 00:00:00 2001 From: Jing Zhang Date: Wed, 31 Jan 2024 11:10:57 -0800 Subject: [PATCH] fix dup last trace (#1973) Signed-off-by: Jing Zhang --- .../algorithms/agent/MLChatAgentRunner.java | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/ml-algorithms/src/main/java/org/opensearch/ml/engine/algorithms/agent/MLChatAgentRunner.java b/ml-algorithms/src/main/java/org/opensearch/ml/engine/algorithms/agent/MLChatAgentRunner.java index c9eb1479f8..27783ff874 100644 --- a/ml-algorithms/src/main/java/org/opensearch/ml/engine/algorithms/agent/MLChatAgentRunner.java +++ b/ml-algorithms/src/main/java/org/opensearch/ml/engine/algorithms/agent/MLChatAgentRunner.java @@ -374,21 +374,6 @@ private void runReAct( .build(); conversationIndexMemory.save(msgTemp, parentInteractionId, traceNumber.addAndGet(1), null); } - if (finalAnswer != null) { - finalAnswer = finalAnswer.trim(); - if (conversationIndexMemory != null) { - // Create final trace message. - ConversationIndexMessage msgTemp = ConversationIndexMessage - .conversationIndexMessageBuilder() - .type("ReAct") - .question(question) - .response(finalAnswer) - .finalAnswer(true) - .sessionId(sessionId) - .build(); - conversationIndexMemory.save(msgTemp, parentInteractionId, traceNumber.addAndGet(1), null); - } - } if (finalAnswer != null) { finalAnswer = finalAnswer.trim(); if (conversationIndexMemory != null) {