Spaces:
Configuration error
Configuration error
deploy 2025-08-11 14:12:38
Browse files- frontend/chat.js +1 -1
- frontend/get_api_keys.js +1 -1
- frontend/script.js +2 -2
frontend/chat.js
CHANGED
@@ -73,7 +73,7 @@ async function generateBotResponse(userMessage) {
|
|
73 |
};
|
74 |
|
75 |
const response = await fetch(
|
76 |
-
"
|
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("
|
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("
|
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("
|
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!")
|