mirror of
https://github.com/slhaf/Partner.git
synced 2026-06-27 17:49:16 +08:00
chore: rename cognition core into context core
This commit is contained in:
@@ -27,7 +27,7 @@ import java.util.concurrent.locks.ReentrantLock;
|
|||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@CapabilityCore(value = "cognition")
|
@CapabilityCore(value = "cognition")
|
||||||
public class CognitionCore implements StateSerializable {
|
public class ContextCore implements StateSerializable {
|
||||||
|
|
||||||
private static final String RECENT_CHAT_MESSAGE_NOTES = """
|
private static final String RECENT_CHAT_MESSAGE_NOTES = """
|
||||||
消息格式:
|
消息格式:
|
||||||
@@ -58,7 +58,7 @@ public class CognitionCore implements StateSerializable {
|
|||||||
|
|
||||||
private final ContextWorkspace contextWorkspace = new ContextWorkspace();
|
private final ContextWorkspace contextWorkspace = new ContextWorkspace();
|
||||||
|
|
||||||
public CognitionCore() {
|
public ContextCore() {
|
||||||
register();
|
register();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -20,15 +20,15 @@ class CognitionCoreTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
void shouldRenderRecentChatMessagesWithWrapperAndNotes() {
|
void shouldRenderRecentChatMessagesWithWrapperAndNotes() {
|
||||||
CognitionCore cognitionCore = new CognitionCore();
|
ContextCore contextCore = new ContextCore();
|
||||||
cognitionCore.getChatMessages().addAll(List.of(
|
contextCore.getChatMessages().addAll(List.of(
|
||||||
new Message(Message.Character.USER, "[[USER]: user-1]: hello"),
|
new Message(Message.Character.USER, "[[USER]: user-1]: hello"),
|
||||||
new Message(Message.Character.ASSISTANT, "[NOT_REPLIED]: wait"),
|
new Message(Message.Character.ASSISTANT, "[NOT_REPLIED]: wait"),
|
||||||
new Message(Message.Character.ASSISTANT, "latest message")
|
new Message(Message.Character.ASSISTANT, "latest message")
|
||||||
));
|
));
|
||||||
|
|
||||||
cognitionCore.refreshRecentChatMessagesContext();
|
contextCore.refreshRecentChatMessagesContext();
|
||||||
String content = cognitionCore.contextWorkspace()
|
String content = contextCore.contextWorkspace()
|
||||||
.resolve(List.of(ContextBlock.FocusedDomain.COMMUNICATION))
|
.resolve(List.of(ContextBlock.FocusedDomain.COMMUNICATION))
|
||||||
.encodeToMessage()
|
.encodeToMessage()
|
||||||
.getContent();
|
.getContent();
|
||||||
|
|||||||
Reference in New Issue
Block a user