mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-11 20:08:37 +00:00
feat: use default params if not provided (#6701)
This commit is contained in:
@@ -105,9 +105,14 @@ test('should be able to render prompt', async t => {
|
||||
'should have param keys'
|
||||
);
|
||||
t.deepEqual(testPrompt?.params, msg.params, 'should have params');
|
||||
t.throws(() => testPrompt?.finish({ src_language: 'abc' }), {
|
||||
instanceOf: Error,
|
||||
});
|
||||
// will use first option if a params not provided
|
||||
t.deepEqual(testPrompt?.finish({ src_language: 'abc' }), [
|
||||
{
|
||||
content: 'translate eng to chs: ',
|
||||
params: { dest_language: 'chs', src_language: 'eng' },
|
||||
role: 'system',
|
||||
},
|
||||
]);
|
||||
});
|
||||
|
||||
test('should be able to render listed prompt', async t => {
|
||||
|
||||
Reference in New Issue
Block a user