@@ -109,11 +109,11 @@
-
-
+
+
-
-
-
+
+
+
diff --git a/client/js/chat.js b/client/js/chat.js
index fc31aa60..b8052cb5 100644
--- a/client/js/chat.js
+++ b/client/js/chat.js
@@ -2,6 +2,7 @@ const query = (obj) =>
Object.keys(obj)
.map((k) => encodeURIComponent(k) + "=" + encodeURIComponent(obj[k]))
.join("&");
+const url_prefix = document.querySelector('body').getAttribute('data-urlprefix')
const markdown = window.markdownit();
const message_box = document.getElementById(`messages`);
const message_input = document.getElementById(`message-input`);
@@ -9,8 +10,8 @@ const box_conversations = document.querySelector(`.top`);
const spinner = box_conversations.querySelector(".spinner");
const stop_generating = document.querySelector(`.stop-generating`);
const send_button = document.querySelector(`#send-button`);
-const user_image = ``;
-const gpt_image = ``;
+const user_image = ``;
+const gpt_image = ``;
let prompt_lock = false;
hljs.addPlugin(new CopyButtonPlugin());
@@ -90,7 +91,7 @@ const ask_gpt = async (message) => {
await new Promise((r) => setTimeout(r, 1000));
window.scrollTo(0, 0);
- const response = await fetch(`/backend-api/v2/conversation`, {
+ const response = await fetch(`${url_prefix}/backend-api/v2/conversation`, {
method: `POST`,
signal: window.controller.signal,
headers: {
@@ -127,7 +128,7 @@ const ask_gpt = async (message) => {
chunk = decodeUnicode(new TextDecoder().decode(value));
- if (chunk.includes(`