Removing post proceess of output
This commit is contained in:
parent
5f8e57d121
commit
7b3e0c1db2
10
llamabot.js
10
llamabot.js
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user