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

@@ -4,7 +4,7 @@
<artifactId>lm-lib</artifactId> <artifactId>lm-lib</artifactId>
<groupId>de.extio</groupId> <groupId>de.extio</groupId>
<name>lm-lib</name> <name>lm-lib</name>
<version>1.6.22</version> <version>1.6.23</version>
<properties> <properties>
<java.version>21</java.version> <java.version>21</java.version>

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 -> { case final BaseAgent a when a.agentType(context) == AgentType.CONVERSATION || a.agentType(context) == AgentType.CONVERSATION_WITH_SYSTEM_PROMPT -> {
context.getGraph().add("↴"); if (context.getConversation() == null) {
if (context.getConversation().getConversation().getLast().type() != TurnType.ASSISTANT) { context.getGraph().add("🗨");
context.getConversation().addTurn(new Conversation.Turn(TurnType.ASSISTANT, context.getLastCompletion().response())); 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()));
}
} }
} }