Fix search of extension prompts by role
This commit is contained in:
parent
5028ae49bd
commit
be95162e64
|
@ -2491,8 +2491,8 @@ function getExtensionPrompt(position = extension_prompt_types.IN_PROMPT, depth =
|
|||
.sort()
|
||||
.map((x) => extension_prompts[x])
|
||||
.filter(x => x.position == position && x.value)
|
||||
.filter(x => x.depth === undefined || x.depth === depth)
|
||||
.filter(x => x.role === undefined || x.role === role)
|
||||
.filter(x => depth === undefined || x.depth === undefined || x.depth === depth)
|
||||
.filter(x => role === undefined || x.role === undefined || x.role === role)
|
||||
.map(x => x.value.trim())
|
||||
.join(separator);
|
||||
if (extension_prompt.length && !extension_prompt.startsWith(separator)) {
|
||||
|
|
|
@ -115,13 +115,13 @@ async function onExtensionFloatingDepthInput() {
|
|||
}
|
||||
|
||||
async function onExtensionFloatingPositionInput(e) {
|
||||
chat_metadata[metadata_keys.position] = e.target.value;
|
||||
chat_metadata[metadata_keys.position] = Number(e.target.value);
|
||||
updateSettings();
|
||||
saveMetadataDebounced();
|
||||
}
|
||||
|
||||
async function onDefaultPositionInput(e) {
|
||||
extension_settings.note.defaultPosition = e.target.value;
|
||||
extension_settings.note.defaultPosition = Number(e.target.value);
|
||||
saveSettingsDebounced();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue