Skip to content

Commit

Permalink
- Fix conflict merge impact
Browse files Browse the repository at this point in the history
  • Loading branch information
humcqc committed Jul 24, 2024
1 parent e00ecea commit 02e82db
Showing 1 changed file with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,7 @@ public void accept(Response<AiMessage> message) {

if (!aiMessage.hasToolExecutionRequests()) {
// If there is no tool Execution request we add the Ai Message directly in the chatMEmory
if (context.hasChatMemory()) {
context.chatMemory(memoryId).add(aiMessage);
}
chatMemory.add(aiMessage);
break;
}

Expand Down Expand Up @@ -247,10 +245,9 @@ public void accept(Response<AiMessage> message) {
// In case of tool Execution request we need to update the AiMessage with tools results
// before adding it into chatMemory
aiMessage = variableHandler.substituteVariables(aiMessage);
if (context.hasChatMemory()) {
chatMemory.add(aiMessage);
tmpToolExecutionResultMessages.forEach(chatMemory::add);
}

chatMemory.add(aiMessage);
tmpToolExecutionResultMessages.forEach(chatMemory::add);

log.debug("Attempting to obtain AI response");
response = context.chatModel.generate(chatMemory.messages(), toolSpecifications);
Expand Down

0 comments on commit 02e82db

Please sign in to comment.