This repository has been archived on 2025-11-27. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
Fitz_Studio/main.py
T
egutierrez b4ca0cf600 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.
2025-05-06 23:33:41 +02:00

34 lines
824 B
Python

# 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():
print("🛠️ Inicializando base de datos...")
init_db()
print("✅ Iniciando sistema...")
asyncio.run(main_async())
if __name__ == "__main__":
main()