Combine functions
| @@ -5669,11 +5669,11 @@ function parseAndSaveLogprobs(data, continueFrom) { | |||
| 5669 | } | 5669 | } |
| 5670 | 5670 | ||
| 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 data | 5673 | * @param {object} data Response data |
| 5674 | * @returns {string} Extracted text | 5674 | * @returns {string} Extracted message |
| 5675 | */ | 5675 | */ |
| 5676 | function getTextContextFromData(data) { | 5676 | function 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 | } |
| 5696 | 5696 | ||
| 5697 | /** | 5697 | /** |
| 5698 | * Extracts the message from the response data. | ||
| 5699 | * @param {object} data Response data | ||
| 5700 | * @returns {string} Extracted message | ||
| 5701 | */ | ||
| 5702 | function 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 data | 5699 | * @param {object} data Response data |
| 5711 | * @returns {string} Extracted reasoning | 5700 | * @returns {string} Extracted reasoning |