diff --git a/public/scripts/custom-request.js b/public/scripts/custom-request.js index 353e6cec0..7ea8f60eb 100644 --- a/public/scripts/custom-request.js +++ b/public/scripts/custom-request.js @@ -272,7 +272,7 @@ export class TextCompletionService { formattedMessages.push(messageContent); } requestData.prompt = formattedMessages.join(''); - const stoppingStrings = getInstructStoppingSequences({ customInstruct: instructPreset, useStopString: false }); + const stoppingStrings = getInstructStoppingSequences({ customInstruct: instructPreset, useStopStrings: false }); requestData.stop = stoppingStrings; requestData.stopping_strings = stoppingStrings; } else { diff --git a/public/scripts/extensions/shared.js b/public/scripts/extensions/shared.js index 9ca630fa9..e4cca98fa 100644 --- a/public/scripts/extensions/shared.js +++ b/public/scripts/extensions/shared.js @@ -299,7 +299,7 @@ export class ConnectionManagerRequestService { * @param {string} profileId * @param {string | (import('../custom-request.js').ChatCompletionMessage & {ignoreInstruct?: boolean})[]} prompt * @param {number} maxTokens - * @param {object} custom + * @param {Object} custom * @param {boolean?} [custom.stream=false] * @param {AbortSignal?} [custom.signal] * @param {boolean?} [custom.extractData=true] diff --git a/public/scripts/instruct-mode.js b/public/scripts/instruct-mode.js index f5b93dd45..7edfb1e0b 100644 --- a/public/scripts/instruct-mode.js +++ b/public/scripts/instruct-mode.js @@ -243,10 +243,12 @@ export function autoSelectInstructPreset(modelId) { /** * Converts instruct mode sequences to an array of stopping strings. - * @param {{customInstruct?: InstructSettings, useStopString?: boolean}} options + * @param {Object} options + * @param {InstructSettings?} [options.customInstruct=null] - Custom instruct settings. + * @param {boolean?} [options.useStopStrings=false] - Decides whether to use "Chat Start" and "Example Separator" * @returns {string[]} Array of instruct mode stopping strings. */ -export function getInstructStoppingSequences({ customInstruct = null, useStopString = false } = {}) { +export function getInstructStoppingSequences({ customInstruct = null, useStopStrings = false } = {}) { const instruct = structuredClone(customInstruct ?? power_user.instruct); /** @@ -296,7 +298,7 @@ export function getInstructStoppingSequences({ customInstruct = null, useStopStr combined_sequence.split('\n').filter((line, index, self) => self.indexOf(line) === index).forEach(addInstructSequence); } - if (useStopString ?? power_user.context.use_stop_strings) { + if (useStopStrings ?? power_user.context.use_stop_strings) { if (power_user.context.chat_start) { result.push(`\n${substituteParams(power_user.context.chat_start)}`); }