Mercurial > code > home > repos > sco-bot
comparison scobot/service/query.py @ 15:6ed25bcaaf1f
add prefect and rebuild flow to k8s
author | drewp@bigasterisk.com |
---|---|
date | Fri, 19 Jul 2024 00:30:47 -0700 |
parents | b9c2b7fedbcd |
children | 7a87ba2f00d9 |
comparison
equal
deleted
inserted
replaced
14:b9c2b7fedbcd | 15:6ed25bcaaf1f |
---|---|
46 # search(q, embedding_fn, client) | 46 # search(q, embedding_fn, client) |
47 | 47 |
48 | 48 |
49 @asynccontextmanager | 49 @asynccontextmanager |
50 async def lifespan(app: FastAPI): | 50 async def lifespan(app: FastAPI): |
51 app.state.index = SearchIndexRO('data/index') | 51 app.state.index = SearchIndexRO('data/build/index0') |
52 yield | 52 yield |
53 | 53 |
54 app = FastAPI(lifespan=lifespan) | 54 app = FastAPI(lifespan=lifespan) |
55 | 55 |
56 @app.get("/sco/query") | 56 @app.get("/sco/query") |