bug fixed

This commit is contained in:
timothyafolami
2024-08-07 18:55:56 +01:00
parent ab418262b1
commit 9a2a4c5fdd
4 changed files with 18 additions and 6 deletions
+5 -3
View File
@@ -1,4 +1,6 @@
# main.py
import sys, os
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
from fastapi import FastAPI, HTTPException
from fastapi.middleware.cors import CORSMiddleware
from pydantic import BaseModel
@@ -33,7 +35,7 @@ app.add_middleware(
class SearchRequest(BaseModel):
query: str
@app.post("/load_documents")
@app.get("/load_documents")
def load_documents(directory: str):
global vector_store
@@ -42,7 +44,7 @@ def load_documents(directory: str):
return {"status": "Documents loaded successfully"}
@app.post("/search")
@app.get("/search")
def search(request: SearchRequest):
global vector_store