tmdeptrai3012 commited on
Commit
ed42e71
·
verified ·
1 Parent(s): 1d78c28

deploy 2025-08-11 14:12:38

Browse files
frontend/chat.js CHANGED
@@ -73,7 +73,7 @@ async function generateBotResponse(userMessage) {
73
  };
74
 
75
  const response = await fetch(
76
- "http://localhost:3012/rag_chat",
77
  // "https://glowing-workable-arachnid.ngrok-free.app/v1/chat/completions",
78
  {
79
  method: "POST",
 
73
  };
74
 
75
  const response = await fetch(
76
+ "/rag_chat",
77
  // "https://glowing-workable-arachnid.ngrok-free.app/v1/chat/completions",
78
  {
79
  method: "POST",
frontend/get_api_keys.js CHANGED
@@ -2,7 +2,7 @@
2
 
3
  async function fetchApiKeys() {
4
  try {
5
- const response = await fetch("http://localhost:3012/api_key");
6
  if (!response.ok) {
7
  throw new Error(`Server error: ${response.status}`);
8
  }
 
2
 
3
  async function fetchApiKeys() {
4
  try {
5
+ const response = await fetch("/api_key");
6
  if (!response.ok) {
7
  throw new Error(`Server error: ${response.status}`);
8
  }
frontend/script.js CHANGED
@@ -262,11 +262,11 @@ document.addEventListener("DOMContentLoaded", function () {
262
  disableChat()
263
  updateStatus("Calling backend to retrieve documents...", "processing");
264
  try {
265
- const retrieveRes = await fetch("http://localhost:3012/retrieve_documents", { method: "POST" });
266
  if (!retrieveRes.ok) throw new Error("Failed to retrieve documents");
267
  updateStatus("Retrieving documents complete. Now ingesting...", "processing");
268
  console.log("Retrieving documents complete. Now ingesting...")
269
- const ingestRes = await fetch("http://localhost:3012/ingest", { method: "POST" });
270
  if (!ingestRes.ok) throw new Error("Failed to ingest documents");
271
  updateStatus("Uploaded and embedded " + uploadedCount + " file(s) successfully!", "success");
272
  console.log("Successfully embedded the documents!")
 
262
  disableChat()
263
  updateStatus("Calling backend to retrieve documents...", "processing");
264
  try {
265
+ const retrieveRes = await fetch("/retrieve_documents", { method: "POST" });
266
  if (!retrieveRes.ok) throw new Error("Failed to retrieve documents");
267
  updateStatus("Retrieving documents complete. Now ingesting...", "processing");
268
  console.log("Retrieving documents complete. Now ingesting...")
269
+ const ingestRes = await fetch("/ingest", { method: "POST" });
270
  if (!ingestRes.ok) throw new Error("Failed to ingest documents");
271
  updateStatus("Uploaded and embedded " + uploadedCount + " file(s) successfully!", "success");
272
  console.log("Successfully embedded the documents!")