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/entrypoint/init_db.py
T
egutierrez aef8791151 feat: Implement main application shell with navigation and color scheme toggle
- Added Appshell component with responsive navbar and main content area
- Integrated ColorSchemeToggle for light/dark mode switching
- Created Welcome component with styled title and introductory text
- Developed ChatPage for LLM interaction with WebSocket support
- Implemented Biblioteca for managing notes with rich text editor
- Added LoginPage for user authentication with error handling
- Introduced MessageList and MessageBubble components for chat messages
- Styled components with CSS modules for consistent design
2025-06-21 02:01:21 +02:00

51 lines
1.4 KiB
Python

# entrypoint/init_db.py
from domains.base import Base
from domains.ConexionSql.Postgres_conexion import PostgresConexion # Asegúrate de tener esta clase implementada correctamente
from domains.Credenciales.postgres_credencial import PostgresCredencial # Asegúrate de tener esta clase implementada correctamente
from domains.Credenciales.postgres_credencial_mmr import PostgresCredencialModel
from domains.ApiKeys.openai_apikey_mmr import OpenAICredencialModel
from domains.Llms.Modelos.Openai_model_mmr import ModeloOpenAIConfigModel
from domains.Llms.Embedders.Openai_embedder_mmr import OpenAIEmbedderModel
from domains.TextManager.biblioteca_mmr import BibliotecaModel
from dotenv import load_dotenv
import os
from entrypoint import ENV_PATH
# Ruta específica al archivo .env
dotenv_path = ENV_PATH
# Cargar el archivo
load_dotenv(dotenv_path)
titulo = os.getenv('DB_TITLE')
usuario = os.getenv('DB_USER')
passwrd = os.getenv('DB_PASSWORD')
host = os.getenv('DB_HOST')
port = os.getenv('DB_PORT')
db_name = os.getenv('DB_NAME')
db_credencial = PostgresCredencial(
titulo=titulo,
user=usuario,
password=passwrd,
host=host,
port=port,
dbname=db_name
)
def init_db():
# Crear engine desde la clase de conexión PostgreSQL
conexion = PostgresConexion(db_credencial)
engine = conexion.get_engine() # Recuperamos el engine directamente
print("Creando tablas...")
Base.metadata.create_all(engine)
print("¡Listo!")