Skip to content

Commit

Permalink
Fix merge conflict
Browse files Browse the repository at this point in the history
Signed-off-by: Arjun kumar Giri <arjung@amazon.com>
  • Loading branch information
Hailong-am authored and arjunkumargiri committed Dec 5, 2023
1 parent 15d1f72 commit 371b685
Showing 1 changed file with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,22 @@ private void runReAct(
.build();
conversationIndexMemory.save(msgTemp, parentInteractionId, traceNumber.addAndGet(1), null);
}
if (finalAnswer != null) {
finalAnswer = finalAnswer.trim();
if (conversationIndexMemory != null) {
String finalAnswer1 = finalAnswer;
// Create final trace message.
ConversationIndexMessage msgTemp = ConversationIndexMessage
.conversationIndexMessageBuilder()
.type("ReAct")
.question(question)
.response(finalAnswer1)
.finalAnswer(true)
.sessionId(sessionId)
.build();
conversationIndexMemory.save(msgTemp, parentInteractionId, traceNumber.addAndGet(1), null);
}
}
if (finalAnswer != null) {
finalAnswer = finalAnswer.trim();
if (conversationIndexMemory != null) {
Expand All @@ -401,7 +417,7 @@ private void runReAct(
.getMemoryManager()
.updateInteraction(
parentInteractionId,
ImmutableMap.of(AI_RESPONSE_FIELD, finalAnswer1),
ImmutableMap.of(AI_RESPONSE_FIELD, finalAnswer1, ADDITIONAL_INFO_FIELD, additionalInfo),
ActionListener.<UpdateResponse>wrap(updateResponse -> {
log.info("Updated final answer into interaction id: {}", parentInteractionId);
log.info("Final answer: {}", finalAnswer1);
Expand Down

0 comments on commit 371b685

Please sign in to comment.