Refactor project structure and implement new features
- Removed unused security module and updated import paths. - Enhanced OpenAI client with streaming capabilities for chat completions. - Added new backend API endpoints for health check (ping). - Established a new FastAPI application with CORS configuration. - Created a new Appshell component for the frontend with navigation links. - Integrated SVG icons and improved styling for the Appshell component. - Implemented memory management for conversation history using PostgreSQL. - Developed abstract classes for AI agents and models, with OpenAI integration. - Added encryption utilities for secure data handling.
This commit is contained in:
@@ -1,11 +1,34 @@
|
||||
# main.py
|
||||
|
||||
import asyncio
|
||||
import uvicorn
|
||||
from entrypoint.init_db import init_db
|
||||
|
||||
from backend.main import app as fastapi_app
|
||||
|
||||
async def main_async():
|
||||
# Inicia tareas de fondo controladas desde aquí
|
||||
print("🔄 Lanzando tareas en segundo plano...")
|
||||
tareas = []
|
||||
|
||||
# Configura y lanza el servidor FastAPI
|
||||
print("🚀 Lanzando servidor FastAPI...")
|
||||
config = uvicorn.Config(app=fastapi_app, host="0.0.0.0", port=8000, reload=True)
|
||||
server = uvicorn.Server(config)
|
||||
|
||||
# Ejecuta servidor (bloqueante)
|
||||
await server.serve()
|
||||
|
||||
# Cancela tareas si se cae el servidor
|
||||
for task in tareas:
|
||||
task.cancel()
|
||||
|
||||
def main():
|
||||
# Aquí puedes colocar lógica adicional de arranque si la tienes
|
||||
print("🛠️ Inicializando base de datos...")
|
||||
init_db()
|
||||
|
||||
print("✅ Iniciando sistema...")
|
||||
asyncio.run(main_async())
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user