Combine functions

This commit is contained in:
Cohee
2025-01-25 00:29:55 +02:00
parent 9250be348d
commit e3885c2b5c

View File

@ -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