without local llm
This commit is contained in:
19
base.py
19
base.py
@ -2,20 +2,30 @@
|
||||
|
||||
import importlib
|
||||
import logging
|
||||
import asyncio
|
||||
|
||||
from typing import Any
|
||||
from fastapi import FastAPI, WebSocket
|
||||
from fastapi.security import APIKeyHeader, APIKeyQuery
|
||||
from fastapi.middleware.cors import CORSMiddleware
|
||||
from fastapi_utils.tasks import repeat_every
|
||||
|
||||
|
||||
logger = logging.getLogger()
|
||||
logger.setLevel(logging.CRITICAL)
|
||||
logger.setLevel(logging.DEBUG)
|
||||
|
||||
|
||||
loop = asyncio.get_event_loop()
|
||||
app = FastAPI(title="codey.lol API",
|
||||
version="0.1a",
|
||||
contact={
|
||||
'name': 'codey'
|
||||
})
|
||||
},
|
||||
loop=loop)
|
||||
|
||||
app.loop = loop
|
||||
|
||||
|
||||
|
||||
constants = importlib.import_module("constants").Constants()
|
||||
util = importlib.import_module("util").Utilities(app, constants)
|
||||
@ -74,6 +84,11 @@ xc_endpoints = importlib.import_module("endpoints.xc").XC(app, util, constants,
|
||||
# Below: CAH endpoint(s)
|
||||
cah_endpoints = importlib.import_module("endpoints.cah").CAH(app, util, constants, glob_state)
|
||||
|
||||
@app.on_event("startup")
|
||||
@repeat_every(seconds=10)
|
||||
async def cah_tasks() -> None:
|
||||
return await cah_endpoints.periodicals()
|
||||
|
||||
|
||||
|
||||
"""
|
||||
|
Reference in New Issue
Block a user