chore: Update version to 1.6.8 and enhance conversation handling in BaseAgent
This commit is contained in:
4
pom.xml
4
pom.xml
@@ -4,13 +4,13 @@
|
|||||||
<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.7</version>
|
<version>1.6.8</version>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<java.version>21</java.version>
|
<java.version>21</java.version>
|
||||||
<maven.compiler.source>21</maven.compiler.source>
|
<maven.compiler.source>21</maven.compiler.source>
|
||||||
<maven.compiler.target>21</maven.compiler.target>
|
<maven.compiler.target>21</maven.compiler.target>
|
||||||
<spring-boot.version>3.5.3</spring-boot.version>
|
<spring-boot.version>3.5.5</spring-boot.version>
|
||||||
<azureai.version>1.0.0-beta.5</azureai.version>
|
<azureai.version>1.0.0-beta.5</azureai.version>
|
||||||
<jtokkit.version>1.1.0</jtokkit.version>
|
<jtokkit.version>1.1.0</jtokkit.version>
|
||||||
<commons-lang3.version>3.12.0</commons-lang3.version>
|
<commons-lang3.version>3.12.0</commons-lang3.version>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
package de.extio.lmlib.agent;
|
package de.extio.lmlib.agent;
|
||||||
|
|
||||||
public enum AgentType {
|
public enum AgentType {
|
||||||
COMPLETION, START_CONVERSATION, CONVERSATION, CONVERSATION_WITH_SYSTEM_PROMPT, PROCESSING_ONLY;
|
COMPLETION, START_CONVERSATION, START_CONVERSATION_WITH_SYSTEM_PROMPT, CONVERSATION, CONVERSATION_WITH_SYSTEM_PROMPT, PROCESSING_ONLY;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -272,6 +272,10 @@ public interface BaseAgent {
|
|||||||
}
|
}
|
||||||
split.context().setConversation(conversation);
|
split.context().setConversation(conversation);
|
||||||
}
|
}
|
||||||
|
else if (this.agentType(split.context()) == AgentType.START_CONVERSATION_WITH_SYSTEM_PROMPT) {
|
||||||
|
conversation = Conversation.create(this.systemPrompt(), split.text());
|
||||||
|
split.context().setConversation(conversation);
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
if (conversation.getConversation().get(0).type() == TurnType.SYSTEM && this.agentType(split.context()) != AgentType.CONVERSATION_WITH_SYSTEM_PROMPT) {
|
if (conversation.getConversation().get(0).type() == TurnType.SYSTEM && this.agentType(split.context()) != AgentType.CONVERSATION_WITH_SYSTEM_PROMPT) {
|
||||||
final String mergedSysAndUser;
|
final String mergedSysAndUser;
|
||||||
@@ -332,7 +336,7 @@ public interface BaseAgent {
|
|||||||
context.setConversation(null);
|
context.setConversation(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
case final BaseAgent a when a.agentType(context) == AgentType.START_CONVERSATION -> {
|
case final BaseAgent a when a.agentType(context) == AgentType.START_CONVERSATION || a.agentType(context) == AgentType.START_CONVERSATION_WITH_SYSTEM_PROMPT -> {
|
||||||
context.getGraph().add("🗨");
|
context.getGraph().add("🗨");
|
||||||
context.setConversation(null);
|
context.setConversation(null);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user