mirror of
https://github.com/morgan9e/chatgpt-web
synced 2026-04-14 00:14:04 +09:00
Strip whitespace
This commit is contained in:
@@ -189,6 +189,8 @@
|
|||||||
} else {
|
} else {
|
||||||
response.choices.map((choice) => {
|
response.choices.map((choice) => {
|
||||||
choice.message.usage = response.usage;
|
choice.message.usage = response.usage;
|
||||||
|
// Remove whitespace around the message that the OpenAI API sometimes returns
|
||||||
|
choice.message.content = choice.message.content.trim();
|
||||||
addMessage(chatId, choice.message);
|
addMessage(chatId, choice.message);
|
||||||
// Use TTS to read the response, if query was recorded
|
// Use TTS to read the response, if query was recorded
|
||||||
if (recorded && "SpeechSynthesisUtterance" in window) {
|
if (recorded && "SpeechSynthesisUtterance" in window) {
|
||||||
|
|||||||
Reference in New Issue
Block a user