feat(Update app structure):

This commit is contained in:
Alexander Myasoedov
2024-11-29 23:11:40 +02:00
parent 65edfe8930
commit 03dcf8c644
14 changed files with 358 additions and 285 deletions
+21
View File
@@ -0,0 +1,21 @@
from asyncio import Event, Queue
from fastapi import FastAPI
tools_inbox: Queue = Queue()
stop_event: Event = Event()
def create_app() -> FastAPI:
"""Create and configure the FastAPI application."""
app = FastAPI()
return app
def get_tools_inbox() -> Queue:
"""Get the global tools inbox queue."""
return tools_inbox
def get_stop_event() -> Event:
"""Get the global stop event."""
return stop_event
+26
View File
@@ -0,0 +1,26 @@
from logging import config
def setup_logging():
config.dictConfig(
{
"version": 1,
"disable_existing_loggers": True,
"handlers": {
"console": {
"class": "logging.StreamHandler",
},
},
"root": {
"handlers": ["console"],
"level": "INFO",
},
"loggers": {
"uvicorn.access": {
"level": "ERROR", # Set higher log level to suppress info logs globally
"handlers": ["console"],
"propagate": False,
}
},
}
)