Fixed variable naming, better jsdoc

972b1e5fa7eb78fa0f5e858774c1889757cf041c

bmen25124 <bmen25124@gmail.com>

3 files changed, +7 -5Ignore whitespace
public/scripts/custom-request.js+1 -1
@@ -272,7 +272,7 @@ export class TextCompletionService {
272 formattedMessages.push(messageContent);272 formattedMessages.push(messageContent);
273 }273 }
274 requestData.prompt = formattedMessages.join('');274 requestData.prompt = formattedMessages.join('');
275 const stoppingStrings = getInstructStoppingSequences({ customInstruct: instructPreset, useStopString: false });275 const stoppingStrings = getInstructStoppingSequences({ customInstruct: instructPreset, useStopStrings: false });
276 requestData.stop = stoppingStrings;276 requestData.stop = stoppingStrings;
277 requestData.stopping_strings = stoppingStrings;277 requestData.stopping_strings = stoppingStrings;
278 } else {278 } else {
public/scripts/extensions/shared.js+1 -1
@@ -299,7 +299,7 @@ export class ConnectionManagerRequestService {
299 * @param {string} profileId299 * @param {string} profileId
300 * @param {string | (import('../custom-request.js').ChatCompletionMessage & {ignoreInstruct?: boolean})[]} prompt300 * @param {string | (import('../custom-request.js').ChatCompletionMessage & {ignoreInstruct?: boolean})[]} prompt
301 * @param {number} maxTokens301 * @param {number} maxTokens
302 * @param {object} custom302 * @param {Object} custom
303 * @param {boolean?} [custom.stream=false]303 * @param {boolean?} [custom.stream=false]
304 * @param {AbortSignal?} [custom.signal]304 * @param {AbortSignal?} [custom.signal]
305 * @param {boolean?} [custom.extractData=true]305 * @param {boolean?} [custom.extractData=true]
public/scripts/instruct-mode.js+5 -3
@@ -243,10 +243,12 @@ export function autoSelectInstructPreset(modelId) {
243243
244/**244/**
245 * Converts instruct mode sequences to an array of stopping strings.245 * Converts instruct mode sequences to an array of stopping strings.
246 * @param {{customInstruct?: InstructSettings, useStopString?: boolean}} options246 * @param {Object} options
247 * @param {InstructSettings?} [options.customInstruct=null] - Custom instruct settings.
248 * @param {boolean?} [options.useStopStrings=false] - Decides whether to use "Chat Start" and "Example Separator"
247 * @returns {string[]} Array of instruct mode stopping strings.249 * @returns {string[]} Array of instruct mode stopping strings.
248 */250 */
249export function getInstructStoppingSequences({ customInstruct = null, useStopString = false } = {}) {251export function getInstructStoppingSequences({ customInstruct = null, useStopStrings = false } = {}) {
250 const instruct = structuredClone(customInstruct ?? power_user.instruct);252 const instruct = structuredClone(customInstruct ?? power_user.instruct);
251253
252 /**254 /**
@@ -296,7 +298,7 @@ export function getInstructStoppingSequences({ customInstruct = null, useStopStr
296 combined_sequence.split('\n').filter((line, index, self) => self.indexOf(line) === index).forEach(addInstructSequence);298 combined_sequence.split('\n').filter((line, index, self) => self.indexOf(line) === index).forEach(addInstructSequence);
297 }299 }
298300
299 if (useStopString ?? power_user.context.use_stop_strings) {301 if (useStopStrings ?? power_user.context.use_stop_strings) {
300 if (power_user.context.chat_start) {302 if (power_user.context.chat_start) {
301 result.push(`\n${substituteParams(power_user.context.chat_start)}`);303 result.push(`\n${substituteParams(power_user.context.chat_start)}`);
302 }304 }