bug fixed
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user