From e3885c2b5c9bd1dfe5ce6d8429de65e43e3ecaf7 Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Sat, 25 Jan 2025 00:29:55 +0200 Subject: [PATCH] Combine functions --- public/script.js | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/public/script.js b/public/script.js index 70e1ccc1e..4c8d65766 100644 --- a/public/script.js +++ b/public/script.js @@ -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