|
@@ -520,11 +520,6 @@
|
|
|
const sendPromptOpenAI = async (model, userPrompt, responseMessageId, _chatId) => {
|
|
|
const responseMessage = history.messages[responseMessageId];
|
|
|
|
|
|
- // Wait until history/message have been updated
|
|
|
- await tick();
|
|
|
-
|
|
|
- scrollToBottom();
|
|
|
-
|
|
|
const docs = messages
|
|
|
.filter((message) => message?.files ?? null)
|
|
|
.map((message) =>
|
|
@@ -593,6 +588,11 @@
|
|
|
: `${OPENAI_API_BASE_URL}`
|
|
|
);
|
|
|
|
|
|
+ // Wait until history/message have been updated
|
|
|
+ await tick();
|
|
|
+
|
|
|
+ scrollToBottom();
|
|
|
+
|
|
|
if (res && res.ok) {
|
|
|
const reader = res.body
|
|
|
.pipeThrough(new TextDecoderStream())
|