fix: Update version to 1.6.23 in pom.xml and add null check for conversation in BaseAgent

This commit is contained in:
extio-de
2025-09-29 18:11:34 +02:00
parent db0cb39127
commit 1650bac4b8
2 changed files with 10 additions and 4 deletions

View File

@@ -351,9 +351,15 @@ public interface BaseAgent {
}
case final BaseAgent a when a.agentType(context) == AgentType.CONVERSATION || a.agentType(context) == AgentType.CONVERSATION_WITH_SYSTEM_PROMPT -> {
context.getGraph().add("↴");
if (context.getConversation().getConversation().getLast().type() != TurnType.ASSISTANT) {
context.getConversation().addTurn(new Conversation.Turn(TurnType.ASSISTANT, context.getLastCompletion().response()));
if (context.getConversation() == null) {
context.getGraph().add("🗨");
context.setConversation(null);
}
else {
context.getGraph().add("↴");
if (context.getConversation().getConversation().getLast().type() != TurnType.ASSISTANT) {
context.getConversation().addTurn(new Conversation.Turn(TurnType.ASSISTANT, context.getLastCompletion().response()));
}
}
}