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
|
||||
@CapabilityCore(value = "cognition")
|
||||
public class CognitionCore implements StateSerializable {
|
||||
public class ContextCore implements StateSerializable {
|
||||
|
||||
private static final String RECENT_CHAT_MESSAGE_NOTES = """
|
||||
消息格式:
|
||||
@@ -58,7 +58,7 @@ public class CognitionCore implements StateSerializable {
|
||||
|
||||
private final ContextWorkspace contextWorkspace = new ContextWorkspace();
|
||||
|
||||
public CognitionCore() {
|
||||
public ContextCore() {
|
||||
register();
|
||||
}
|
||||
|
||||
@@ -20,15 +20,15 @@ class CognitionCoreTest {
|
||||
|
||||
@Test
|
||||
void shouldRenderRecentChatMessagesWithWrapperAndNotes() {
|
||||
CognitionCore cognitionCore = new CognitionCore();
|
||||
cognitionCore.getChatMessages().addAll(List.of(
|
||||
ContextCore contextCore = new ContextCore();
|
||||
contextCore.getChatMessages().addAll(List.of(
|
||||
new Message(Message.Character.USER, "[[USER]: user-1]: hello"),
|
||||
new Message(Message.Character.ASSISTANT, "[NOT_REPLIED]: wait"),
|
||||
new Message(Message.Character.ASSISTANT, "latest message")
|
||||
));
|
||||
|
||||
cognitionCore.refreshRecentChatMessagesContext();
|
||||
String content = cognitionCore.contextWorkspace()
|
||||
contextCore.refreshRecentChatMessagesContext();
|
||||
String content = contextCore.contextWorkspace()
|
||||
.resolve(List.of(ContextBlock.FocusedDomain.COMMUNICATION))
|
||||
.encodeToMessage()
|
||||
.getContent();
|
||||
|
||||
Reference in New Issue
Block a user