feat: add baseSystemPrompt

This commit is contained in:
2026-05-19 23:24:34 +09:00
parent 882e12340c
commit f964d4de9b
5 changed files with 49 additions and 6 deletions

View File

@@ -29,6 +29,18 @@ describe('Persona initialization', () => {
expect(debug).toContain('persona.initialized');
});
it('exposes baseSystemPrompt on the persona instance when provided', async () => {
const memory = new InMemoryMemoryStore();
const persona = new Persona('Hana', 'Hana is a cheerful barista.', {
memory,
now: '2026-05-01T10:00:00.000Z',
baseSystemPrompt: 'You are a helpful assistant. Always be kind.',
});
await persona.ready();
expect(persona.baseSystemPrompt).toBe('You are a helpful assistant. Always be kind.');
});
it('loads an existing persona space by space id without creating another space', async () => {
const memory = new InMemoryMemoryStore();
const created = new Persona('Joon', 'Joon is a freelance designer.', { memory, now: '2026-05-01T10:00:00.000Z' });