Merge pull request #3273 from cierru/force_chid_in_generate_quite_prompt

Add the option to specify a character for generateQuietPrompt
This commit is contained in:
Cohee
2025-01-07 20:18:56 +02:00
committed by GitHub

View File

@ -2714,9 +2714,10 @@ export function getStoppingStrings(isImpersonate, isContinue) {
* @param {string} quietImage Image to use for the quiet prompt
* @param {string} quietName Name to use for the quiet prompt (defaults to "System:")
* @param {number} [responseLength] Maximum response length. If unset, the global default value is used.
* @param {number} force_chid Character ID to use for this generation run. Works in groups only.
* @returns
*/
export async function generateQuietPrompt(quiet_prompt, quietToLoud, skipWIAN, quietImage = null, quietName = null, responseLength = null) {
export async function generateQuietPrompt(quiet_prompt, quietToLoud, skipWIAN, quietImage = null, quietName = null, responseLength = null, force_chid = null) {
console.log('got into genQuietPrompt');
const responseLengthCustomized = typeof responseLength === 'number' && responseLength > 0;
let originalResponseLength = -1;
@ -2729,6 +2730,7 @@ export async function generateQuietPrompt(quiet_prompt, quietToLoud, skipWIAN, q
force_name2: true,
quietImage: quietImage,
quietName: quietName,
force_chid: force_chid,
};
originalResponseLength = responseLengthCustomized ? saveResponseLength(main_api, responseLength) : -1;
return await Generate('quiet', options);