feat: frontend file upload support

This commit is contained in:
Timothy J. Baek 2024-01-07 00:57:10 -08:00
parent 3229ec116c
commit fef4725d56
6 changed files with 223 additions and 92 deletions

View file

@ -91,7 +91,7 @@ def store_web(form_data: StoreWebForm):
loader = WebBaseLoader(form_data.url)
data = loader.load()
store_data_in_vector_db(data, form_data.collection_name)
return {"status": True}
return {"status": True, "collection_name": form_data.collection_name}
except Exception as e:
print(e)
raise HTTPException(
@ -129,7 +129,7 @@ def store_doc(collection_name: str = Form(...), file: UploadFile = File(...)):
data = loader.load()
store_data_in_vector_db(data, collection_name)
return {"status": True}
return {"status": True, "collection_name": collection_name}
except Exception as e:
print(e)
raise HTTPException(