Removing post proceess of output

This commit is contained in:
Raven Scott 2023-04-16 16:22:57 +02:00
parent 5f8e57d121
commit 7b3e0c1db2

View File

@ -190,12 +190,10 @@ async function generateResponse(conversation) {
console.log(JSON.stringify(responseData))
const choice = responseData.choices[0];
// Remove "user None:" and any text after it from the response
const responseText = choice.message.content.trim();
const startIndex = responseText.indexOf('user None:');
const sanitizedResponse = startIndex === -1 ? responseText : responseText.substring(0, startIndex);
return sanitizedResponse;
const responseText = choice.message.content
return responseText;
} catch (err) {
throw err;
} finally {