feat: add baseSystemPrompt
This commit is contained in:
@@ -124,4 +124,30 @@ describe('Conversation API', () => {
|
||||
expect(mode).toBe('start-conversation');
|
||||
expect(started.messages).toEqual(['오늘 좀 조용하네.']);
|
||||
});
|
||||
|
||||
it('includes baseSystemPrompt at the start of the instruction when provided', async () => {
|
||||
const memory = new InMemoryMemoryStore();
|
||||
let captured: ReplyGenerationInput | undefined;
|
||||
const persona = new Persona('Mina', 'Mina likes quiet cafes.', {
|
||||
memory,
|
||||
now: '2026-05-01T10:00:00.000Z',
|
||||
baseSystemPrompt: 'You are a helpful assistant. Always be kind.',
|
||||
models: {
|
||||
conversation: {
|
||||
async generateReply(input) {
|
||||
captured = input;
|
||||
return { messages: ['Hello!'] };
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
await persona.ready();
|
||||
|
||||
await persona.sendMessage({
|
||||
datetime: '2026-05-01T12:00:00.000Z',
|
||||
messageHistory: [{ sender: 'user', time: '2026-05-01T12:00:00.000Z', content: 'Hi' }],
|
||||
});
|
||||
|
||||
expect(captured?.instruction.startsWith('You are a helpful assistant. Always be kind.')).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user