| 5927 | chat[chat.length - 1]['extra'] = {}; | 5927 | chat[chat.length - 1]['extra'] = {}; |
| 5928 | } | 5928 | } |
| 5929 | | 5929 | |
| | 5930 | // Coerce null/undefined to empty string |
| | 5931 | if (!chat[chat.length - 1]['extra']['reasoning']) { |
| | 5932 | chat[chat.length - 1]['extra']['reasoning'] = ''; |
| | 5933 | } |
| | 5934 | |
| | 5935 | if (!reasoning) { |
| | 5936 | reasoning = ''; |
| | 5937 | } |
| | 5938 | |
| 5930 | let oldMessage = ''; | 5939 | let oldMessage = ''; |
| 5931 | const generationFinished = new Date(); | 5940 | const generationFinished = new Date(); |
| 5932 | const img = extractImageFromMessage(getMessage); | 5941 | const img = extractImageFromMessage(getMessage); |