mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-02-09 08:38:53 +01:00
Role filter conditions
This commit is contained in:
parent
9e968de4e4
commit
5207b3a7f0
@ -1336,16 +1336,18 @@ function getMessagesCallback(args, value) {
|
||||
return true;
|
||||
}
|
||||
|
||||
const isNarrator = mes.extra?.type === system_message_types.NARRATOR;
|
||||
|
||||
if (role === 'system') {
|
||||
return mes.extra?.type === system_message_types.NARRATOR;
|
||||
return isNarrator && !mes.is_user;
|
||||
}
|
||||
|
||||
if (role === 'assistant') {
|
||||
return !mes.is_user;
|
||||
return !isNarrator && !mes.is_user;
|
||||
}
|
||||
|
||||
if (role === 'user') {
|
||||
return mes.is_user;
|
||||
return !isNarrator && mes.is_user;
|
||||
}
|
||||
|
||||
throw new Error(`Invalid role provided. Expected one of: system, assistant, user. Got: ${role}`);
|
||||
|
Loading…
x
Reference in New Issue
Block a user