Combine functions

e3885c2b5c9bd1dfe5ce6d8429de65e43e3ecaf7

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +4 -15Showing whitespace changes
public/script.js+4 -15
@@ -5669,11 +5669,11 @@ function parseAndSaveLogprobs(data, continueFrom) {
5669}5669}
56705670
5671/**5671/**
5672 * Gets the text context from the response data.5672 * Extracts the message from the response data.
5673 * @param {object} data Response JSON data5673 * @param {object} data Response data
5674 * @returns {string} Extracted text5674 * @returns {string} Extracted message
5675 */5675 */
5676function getTextContextFromData(data) {5676function extractMessageFromData(data){
5677 if (typeof data === 'string') {5677 if (typeof data === 'string') {
5678 return data;5678 return data;
5679 }5679 }
@@ -5695,17 +5695,6 @@ function getTextContextFromData(data) {
5695}5695}
56965696
5697/**5697/**
5698 * Extracts the message from the response data.
5699 * @param {object} data Response data
5700 * @returns {string} Extracted message
5701 */
5702function extractMessageFromData(data){
5703 const content = String(getTextContextFromData(data) ?? '');
5704
5705 return content;
5706}
5707
5708/**
5709 * Extracts the reasoning from the response data.5698 * Extracts the reasoning from the response data.
5710 * @param {object} data Response data5699 * @param {object} data Response data
5711 * @returns {string} Extracted reasoning5700 * @returns {string} Extracted reasoning