Strip whitespace
This commit is contained in:
parent
77344ef691
commit
bab6028893
|
@ -189,6 +189,8 @@
|
|||
} else {
|
||||
response.choices.map((choice) => {
|
||||
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);
|
||||
// Use TTS to read the response, if query was recorded
|
||||
if (recorded && "SpeechSynthesisUtterance" in window) {
|
||||
|
|
Loading…
Reference in New Issue