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()
|
.sort()
|
||||||
.map((x) => extension_prompts[x])
|
.map((x) => extension_prompts[x])
|
||||||
.filter(x => x.position == position && x.value)
|
.filter(x => x.position == position && x.value)
|
||||||
.filter(x => x.depth === undefined || x.depth === depth)
|
.filter(x => depth === undefined || x.depth === undefined || x.depth === depth)
|
||||||
.filter(x => x.role === undefined || x.role === role)
|
.filter(x => role === undefined || x.role === undefined || x.role === role)
|
||||||
.map(x => x.value.trim())
|
.map(x => x.value.trim())
|
||||||
.join(separator);
|
.join(separator);
|
||||||
if (extension_prompt.length && !extension_prompt.startsWith(separator)) {
|
if (extension_prompt.length && !extension_prompt.startsWith(separator)) {
|
||||||
|
|
|
@ -115,13 +115,13 @@ async function onExtensionFloatingDepthInput() {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function onExtensionFloatingPositionInput(e) {
|
async function onExtensionFloatingPositionInput(e) {
|
||||||
chat_metadata[metadata_keys.position] = e.target.value;
|
chat_metadata[metadata_keys.position] = Number(e.target.value);
|
||||||
updateSettings();
|
updateSettings();
|
||||||
saveMetadataDebounced();
|
saveMetadataDebounced();
|
||||||
}
|
}
|
||||||
|
|
||||||
async function onDefaultPositionInput(e) {
|
async function onDefaultPositionInput(e) {
|
||||||
extension_settings.note.defaultPosition = e.target.value;
|
extension_settings.note.defaultPosition = Number(e.target.value);
|
||||||
saveSettingsDebounced();
|
saveSettingsDebounced();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue