minorfix-3

pull/50/head
Alex 2 years ago
parent b480917dc6
commit ac7cc26022

@ -44,15 +44,12 @@ def api_answer():
vectorstore = "vectors/" + data["active_docs"]
if data['active_docs'] == "default":
vectorstore = ""
else:
vectorstore = ""
# loading the index and the store and the prompt template
index = faiss.read_index(f"{vectorstore}docs.index")
with open(f"{vectorstore}faiss_store.pkl", "rb") as f:
store = pickle.load(f)
@ -72,8 +69,6 @@ def api_answer():
# "answer": "The answer is 42",
# "sources": ["https://en.wikipedia.org/wiki/42_(number)", "https://en.wikipedia.org/wiki/42_(number)"]
# }
return result
@app.route("/api/docs_check", methods=["POST"])

@ -13,6 +13,9 @@ if (el) {
document.getElementById("message-input").value = "";
document.getElementById("button-submit").innerHTML = '<i class="fa fa-circle-o-notch fa-spin"></i> Thinking...';
document.getElementById("button-submit").disabled = true;
if (localStorage.getItem('activeDocs') == null) {
localStorage.setItem('activeDocs', 'default')
}
fetch('/api/answer', {
method: 'POST',
@ -22,7 +25,7 @@ if (el) {
body: JSON.stringify({question: message,
api_key: localStorage.getItem('apiKey'),
active_docs: localStorage.getItem('activeDocs'),}),
active_docs: localStorage.getItem('activeDocs')}),
})
.then(response => response.json())
.then(data => {

Loading…
Cancel
Save