Fixed variable naming, better jsdoc

972b1e5fa7eb78fa0f5e858774c1889757cf041c

bmen25124 <bmen25124@gmail.com>

3 files changed, +7 -5Showing whitespace changes
public/scripts/custom-request.js+1 -1
@@ -272,7 +272,7 @@ export class TextCompletionService {
272272 formattedMessages.push(messageContent);
273273 }
274274 requestData.prompt = formattedMessages.join('');
275275 const stoppingStrings = getInstructStoppingSequences({ customInstruct: instructPreset, useStopStringuseStopStrings: false });
276276 requestData.stop = stoppingStrings;
277277 requestData.stopping_strings = stoppingStrings;
278278 } else {
public/scripts/extensions/shared.js+1 -1
@@ -299,7 +299,7 @@ export class ConnectionManagerRequestService {
299299 * @param {string} profileId
300300 * @param {string | (import('../custom-request.js').ChatCompletionMessage & {ignoreInstruct?: boolean})[]} prompt
301301 * @param {number} maxTokens
302302 * @param {objectObject} custom
303303 * @param {boolean?} [custom.stream=false]
304304 * @param {AbortSignal?} [custom.signal]
305305 * @param {boolean?} [custom.extractData=true]
public/scripts/instruct-mode.js+5 -3
@@ -243,10 +243,12 @@ export function autoSelectInstructPreset(modelId) {
243243
244244/**
245245 * Converts instruct mode sequences to an array of stopping strings.
246246 * @param {{customInstruct?: InstructSettings, useStopString?: boolean}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"
247249 * @returns {string[]} Array of instruct mode stopping strings.
248250 */
249251export function getInstructStoppingSequences({ customInstruct = null, useStopStringuseStopStrings = false } = {}) {
250252 const instruct = structuredClone(customInstruct ?? power_user.instruct);
251253
252254 /**
@@ -296,7 +298,7 @@ export function getInstructStoppingSequences({ customInstruct = null, useStopStr
296298 combined_sequence.split('\n').filter((line, index, self) => self.indexOf(line) === index).forEach(addInstructSequence);
297299 }
298300
299301 if (useStopStringuseStopStrings ?? power_user.context.use_stop_strings) {
300302 if (power_user.context.chat_start) {
301303 result.push(`\n${substituteParams(power_user.context.chat_start)}`);
302304 }