update git ignore
This commit is contained in:
@@ -10,14 +10,17 @@ app = FastAPI()
|
|||||||
templates = Jinja2Templates(directory="templates")
|
templates = Jinja2Templates(directory="templates")
|
||||||
vector_store = VectorStore()
|
vector_store = VectorStore()
|
||||||
|
|
||||||
|
|
||||||
@app.on_event("startup")
|
@app.on_event("startup")
|
||||||
async def startup_event():
|
async def startup_event():
|
||||||
await vector_store.initialize()
|
await vector_store.initialize()
|
||||||
|
|
||||||
|
|
||||||
@app.get("/", response_class=HTMLResponse)
|
@app.get("/", response_class=HTMLResponse)
|
||||||
async def form_get(request: Request):
|
async def form_get(request: Request):
|
||||||
return templates.TemplateResponse("search.html", {"request": request, "results": None})
|
return templates.TemplateResponse("search.html", {"request": request, "results": None})
|
||||||
|
|
||||||
|
|
||||||
@app.post("/", response_class=HTMLResponse)
|
@app.post("/", response_class=HTMLResponse)
|
||||||
async def form_post(request: Request, query: str = Form(...)):
|
async def form_post(request: Request, query: str = Form(...)):
|
||||||
results = await vector_store.search(query, threshold=0.2)
|
results = await vector_store.search(query, threshold=0.2)
|
||||||
|
|||||||
Reference in New Issue
Block a user