Declare prepareOpenAIMessages as synchronous

As there is no need for the function o be async anymore.
This commit is contained in:
maver 2023-06-24 19:53:33 +02:00
parent 6c25211f0a
commit 6e37db2fb3
2 changed files with 3 additions and 3 deletions

View File

@ -2795,7 +2795,7 @@ async function Generate(type, { automatic_trigger, force_name2, resolve, reject,
generate_data = getNovelGenerationData(finalPromt, this_settings, this_amount_gen, isImpersonate);
}
else if (main_api == 'openai') {
let [prompt, counts] = await prepareOpenAIMessages({
let [prompt, counts] = prepareOpenAIMessages({
name2: name2,
charDescription: charDescription,
charPersonality: charPersonality,

View File

@ -522,9 +522,9 @@ function populateChatCompletion (prompts, chatCompletion, {bias, quietPrompt, ty
* @param {string} options.type - The type of the chat, can be 'impersonate'.
* @param {string} options.quietPrompt - The quiet prompt to be used in the conversation.
* @param {Array} options.extensionPrompts - An array of additional prompts.
* @returns {Promise<Array>} An array where the first element is the prepared chat and the second element is a boolean flag.
* @returns {(*[]|boolean)[]} An array where the first element is the prepared chat and the second element is a boolean flag.
*/
async function prepareOpenAIMessages({
function prepareOpenAIMessages({
name2,
charDescription,
charPersonality,