mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Combine functions
This commit is contained in:
@ -5669,11 +5669,11 @@ function parseAndSaveLogprobs(data, continueFrom) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the text context from the response data.
|
||||
* @param {object} data Response JSON data
|
||||
* @returns {string} Extracted text
|
||||
* Extracts the message from the response data.
|
||||
* @param {object} data Response data
|
||||
* @returns {string} Extracted message
|
||||
*/
|
||||
function getTextContextFromData(data) {
|
||||
function extractMessageFromData(data){
|
||||
if (typeof data === 'string') {
|
||||
return data;
|
||||
}
|
||||
@ -5694,17 +5694,6 @@ function getTextContextFromData(data) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Extracts the message from the response data.
|
||||
* @param {object} data Response data
|
||||
* @returns {string} Extracted message
|
||||
*/
|
||||
function extractMessageFromData(data){
|
||||
const content = String(getTextContextFromData(data) ?? '');
|
||||
|
||||
return content;
|
||||
}
|
||||
|
||||
/**
|
||||
* Extracts the reasoning from the response data.
|
||||
* @param {object} data Response data
|
||||
|
Reference in New Issue
Block a user