diff --git a/backend/domains/llms/llm_chat_endpoint_v1.py b/backend/domains/llms/llm_chat_endpoint_v1.py new file mode 100644 index 0000000..437220b --- /dev/null +++ b/backend/domains/llms/llm_chat_endpoint_v1.py @@ -0,0 +1,44 @@ +# backend/domains/llm/agent_endpoints.py + +from fastapi import APIRouter, HTTPException +from fastapi.responses import StreamingResponse +from pydantic import BaseModel +from fastapi.concurrency import run_in_threadpool + +from backend.domains.llms.llm_chat_srvc import construir_agente_llm, responder, responder_stream +from src.Logger.logger_db import LoggerDB, logger +from entrypoint.init_db import db_credencial + +LoggerDB(db_credencial, "logger_llm", created_by="sistema") + +router = APIRouter() +agente = construir_agente_llm() # inicializa el agente una vez + +# πŸ“₯ Schema para entrada de prompt +class ChatInput(BaseModel): + prompt: str + +# βœ… Endpoint de respuesta simple +@router.post("/chat", summary="Enviar prompt y obtener respuesta completa del agente") +async def chat_endpoint(data: ChatInput): + try: + return await responder(data.prompt, agente) + except ValueError as e: + raise HTTPException(status_code=400, detail=str(e)) + except Exception as e: + logger.exception("[ERROR] Fallo durante respuesta del agente:") + raise HTTPException(status_code=500, detail="Error interno al procesar la solicitud.") + +# πŸ” Endpoint de streaming +@router.post("/chat-stream", summary="Enviar prompt y recibir respuesta del agente en streaming") +async def chat_stream_endpoint(data: ChatInput): + try: + return StreamingResponse( + responder_stream(data.prompt, agente), + media_type="text/plain" + ) + except ValueError as e: + raise HTTPException(status_code=400, detail=str(e)) + except Exception as e: + logger.exception("[ERROR] Fallo durante respuesta en streaming:") + raise HTTPException(status_code=500, detail="Error interno en el agente.") diff --git a/backend/domains/llms/llm_chat_srvc.py b/backend/domains/llms/llm_chat_srvc.py new file mode 100644 index 0000000..f77d3c5 --- /dev/null +++ b/backend/domains/llms/llm_chat_srvc.py @@ -0,0 +1,84 @@ +# src/services/agent_service.py + +from src.ApiKeys.openai_apikey_mmr import OpenAICredencialRepo +from src.ConexionSql.Postgres_conexion import PostgresConexion +from src.ConexionApis.OpenAi_conexion import OpenAICliente +from src.Llms.Modelos.Openai_model import ModeloOpenAI +from src.Llms.Agente import AgenteAI +from src.Llms.Memory.postgres_MemoryConv import MemoryConvPostgres +from src.Llms.MCPs.McpClient import MCPClient +from src.Llms.MCPs.McpClient_Registry import ClientRegistry +from entrypoint.init_db import db_credencial + +from src.Logger.logger_db import LoggerDB, logger +LoggerDB(db_credencial, "logger_llm", created_by="sistema") + +from typing import AsyncGenerator + +# πŸ”§ InicializaciΓ³n ΓΊnica del agente +def construir_agente_llm() -> AgenteAI: + logger.info("[INICIO] Inicializando agente LLM...") + + conexion = PostgresConexion(db_credencial) + + # Paso 1: Obtener credencial + repo = OpenAICredencialRepo(conexion) + credencial = repo.get_by_id("OPAK20250513-61b29978b7604031014") + if not credencial: + raise ValueError("No se encontrΓ³ la credencial OpenAI") + + logger.debug(f"[OK] Credencial OpenAI cargada: {credencial.titulo}") + + # Paso 2: Crear cliente + cliente = OpenAICliente(credencial) + + # Paso 3: Instanciar modelo + modelo = ModeloOpenAI( + cliente=cliente, + model="gpt-4o", + temperature=1 + ) + + # Paso 4: Memoria en PostgreSQL + memoria = MemoryConvPostgres( + credencial=db_credencial, + nombre_tabla="memoria_conversacion_pruebas", + k=10 + ) + + # Paso 5: Herramientas MCP (ej. archivos) + archivos = MCPClient.from_http( + name="files", + url="http://127.0.0.1:4201/fs" + ) + registry = ClientRegistry() + registry.add("files", archivos) + + # Paso 6: Agente + agente = AgenteAI( + modelo=modelo, + nombre="Asistente Inteligente", + descripcion="", + system_prompt="", + rol="asistente", + objetivos=[], + max_iterations=0, + memoria=memoria, + mcp=registry + ) + + logger.success("[OK] Agente LLM listo.") + return agente + +# ⚑ FunciΓ³n simple +async def responder(prompt: str, agente: AgenteAI) -> str: + logger.info(f"[PeticiΓ³n] Prompt recibido: {prompt[:50]}...") + respuesta = await agente.interactuar_en_bucle(prompt=prompt, stream=False) + logger.debug(f"[Respuesta] {respuesta[:100]}...") + return respuesta + +# πŸ” FunciΓ³n en streaming +async def responder_stream(prompt: str, agente: AgenteAI) -> AsyncGenerator[str, None]: + logger.info(f"[Streaming] Prompt recibido: {prompt[:50]}...") + async for token in agente.interactuar_en_bucle(prompt=prompt, stream=True): + yield token diff --git a/backend/domains/llms/llm_chat_ws_endpoint_v1.py b/backend/domains/llms/llm_chat_ws_endpoint_v1.py new file mode 100644 index 0000000..57bd062 --- /dev/null +++ b/backend/domains/llms/llm_chat_ws_endpoint_v1.py @@ -0,0 +1,35 @@ +from fastapi import WebSocket, APIRouter, WebSocketDisconnect +from backend.domains.llms.llm_chat_srvc import construir_agente_llm +from src.Logger.logger_db import LoggerDB, logger +from entrypoint.init_db import db_credencial +import json + +LoggerDB(db_credencial, "logger_llm_ws", created_by="sistema") + +router = APIRouter() +agente = construir_agente_llm() + +@router.websocket("/ws/chat") +async def chat_ws(websocket: WebSocket): + await websocket.accept() + try: + data = await websocket.receive_text() + parsed = json.loads(data) + prompt = parsed.get("prompt") + if not prompt: + await websocket.send_text("⚠️ Prompt vacΓ­o.") + await websocket.close() + return + + # βœ… SoluciΓ³n: hacer await antes de iterar + respuesta_gen = await agente.interactuar_en_bucle(prompt=prompt, stream=True) + async for token in respuesta_gen: + await websocket.send_text(token) + + await websocket.close() + + except WebSocketDisconnect: + logger.info("πŸ”Œ WebSocket desconectado por el cliente.") + except Exception as e: + logger.exception("❌ Error en WebSocket:") + await websocket.close() diff --git a/backend/main.py b/backend/main.py index d076a11..954fe5f 100644 --- a/backend/main.py +++ b/backend/main.py @@ -3,6 +3,8 @@ from fastapi import FastAPI from fastapi.middleware.cors import CORSMiddleware from backend.router_v1 import router +from backend.domains.llms import llm_chat_ws_endpoint_v1 + app = FastAPI( title="Fitz Backend", @@ -21,4 +23,5 @@ app.add_middleware( # Incluye las rutas de tu API -app.include_router(router, prefix="/api/v1", tags=["v1"]) \ No newline at end of file +app.include_router(router, prefix="/api/v1", tags=["v1"]) +app.include_router(llm_chat_ws_endpoint_v1.router) diff --git a/backend/router_v1.py b/backend/router_v1.py index 4e3865c..4cfebd7 100644 --- a/backend/router_v1.py +++ b/backend/router_v1.py @@ -4,9 +4,10 @@ from fastapi import APIRouter from backend.domains.experiments import charts_examples_endpoint_v1 as charts from backend.domains.experiments import ping_endpoint_v1 from backend.domains.text_manager import text_manager_endpoint_v1 - +from backend.domains.llms import llm_chat_endpoint_v1 router = APIRouter() router.include_router(ping_endpoint_v1.router, prefix="/ping") router.include_router(text_manager_endpoint_v1.router, prefix="/text_manager") router.include_router(charts.router, prefix="/charts") +router.include_router(llm_chat_endpoint_v1.router, prefix="/llm", tags=["Agente LLM"]) # ← Nuevo router diff --git a/data/files/txt/tree.txt b/data/files/txt/tree.txt index 14726f1..76e9232 100644 --- a/data/files/txt/tree.txt +++ b/data/files/txt/tree.txt @@ -1,1021 +1,31 @@ -E:\Fitz_Studio -β”œβ”€β”€ .git -β”‚ β”œβ”€β”€ COMMIT_EDITMSG -β”‚ β”œβ”€β”€ FETCH_HEAD -β”‚ β”œβ”€β”€ HEAD -β”‚ β”œβ”€β”€ ORIG_HEAD -β”‚ β”œβ”€β”€ config -β”‚ β”œβ”€β”€ description -β”‚ β”œβ”€β”€ hooks -β”‚ β”‚ β”œβ”€β”€ applypatch-msg.sample -β”‚ β”‚ β”œβ”€β”€ commit-msg.sample -β”‚ β”‚ β”œβ”€β”€ fsmonitor-watchman.sample -β”‚ β”‚ β”œβ”€β”€ post-update.sample -β”‚ β”‚ β”œβ”€β”€ pre-applypatch.sample -β”‚ β”‚ β”œβ”€β”€ pre-commit.sample -β”‚ β”‚ β”œβ”€β”€ pre-merge-commit.sample -β”‚ β”‚ β”œβ”€β”€ pre-push.sample -β”‚ β”‚ β”œβ”€β”€ pre-rebase.sample -β”‚ β”‚ β”œβ”€β”€ pre-receive.sample -β”‚ β”‚ β”œβ”€β”€ prepare-commit-msg.sample -β”‚ β”‚ β”œβ”€β”€ push-to-checkout.sample -β”‚ β”‚ β”œβ”€β”€ sendemail-validate.sample -β”‚ β”‚ └── update.sample -β”‚ β”œβ”€β”€ index -β”‚ β”œβ”€β”€ info -β”‚ β”‚ └── exclude -β”‚ β”œβ”€β”€ logs -β”‚ β”‚ β”œβ”€β”€ HEAD -β”‚ β”‚ └── refs -β”‚ β”œβ”€β”€ objects -β”‚ β”‚ β”œβ”€β”€ 00 -β”‚ β”‚ β”œβ”€β”€ 01 -β”‚ β”‚ β”œβ”€β”€ 04 -β”‚ β”‚ β”œβ”€β”€ 05 -β”‚ β”‚ β”œβ”€β”€ 06 -β”‚ β”‚ β”œβ”€β”€ 08 -β”‚ β”‚ β”œβ”€β”€ 0a -β”‚ β”‚ β”œβ”€β”€ 0b -β”‚ β”‚ β”œβ”€β”€ 0c -β”‚ β”‚ β”œβ”€β”€ 0d -β”‚ β”‚ β”œβ”€β”€ 0e -β”‚ β”‚ β”œβ”€β”€ 10 -β”‚ β”‚ β”œβ”€β”€ 11 -β”‚ β”‚ β”œβ”€β”€ 13 -β”‚ β”‚ β”œβ”€β”€ 15 -β”‚ β”‚ β”œβ”€β”€ 17 -β”‚ β”‚ β”œβ”€β”€ 18 -β”‚ β”‚ β”œβ”€β”€ 19 -β”‚ β”‚ β”œβ”€β”€ 1a -β”‚ β”‚ β”œβ”€β”€ 1b -β”‚ β”‚ β”œβ”€β”€ 1d -β”‚ β”‚ β”œβ”€β”€ 1e -β”‚ β”‚ β”œβ”€β”€ 1f -β”‚ β”‚ β”œβ”€β”€ 20 -β”‚ β”‚ β”œβ”€β”€ 21 -β”‚ β”‚ β”œβ”€β”€ 22 -β”‚ β”‚ β”œβ”€β”€ 23 -β”‚ β”‚ β”œβ”€β”€ 24 -β”‚ β”‚ β”œβ”€β”€ 25 -β”‚ β”‚ β”œβ”€β”€ 26 -β”‚ β”‚ β”œβ”€β”€ 27 -β”‚ β”‚ β”œβ”€β”€ 28 -β”‚ β”‚ β”œβ”€β”€ 2b -β”‚ β”‚ β”œβ”€β”€ 2c -β”‚ β”‚ β”œβ”€β”€ 2d -β”‚ β”‚ β”œβ”€β”€ 2f -β”‚ β”‚ β”œβ”€β”€ 31 -β”‚ β”‚ β”œβ”€β”€ 32 -β”‚ β”‚ β”œβ”€β”€ 33 -β”‚ β”‚ β”œβ”€β”€ 34 -β”‚ β”‚ β”œβ”€β”€ 36 -β”‚ β”‚ β”œβ”€β”€ 39 -β”‚ β”‚ β”œβ”€β”€ 3a -β”‚ β”‚ β”œβ”€β”€ 3c -β”‚ β”‚ β”œβ”€β”€ 3d -β”‚ β”‚ β”œβ”€β”€ 3e -β”‚ β”‚ β”œβ”€β”€ 3f -β”‚ β”‚ β”œβ”€β”€ 40 -β”‚ β”‚ β”œβ”€β”€ 41 -β”‚ β”‚ β”œβ”€β”€ 42 -β”‚ β”‚ β”œβ”€β”€ 43 -β”‚ β”‚ β”œβ”€β”€ 44 -β”‚ β”‚ β”œβ”€β”€ 45 -β”‚ β”‚ β”œβ”€β”€ 47 -β”‚ β”‚ β”œβ”€β”€ 48 -β”‚ β”‚ β”œβ”€β”€ 4a -β”‚ β”‚ β”œβ”€β”€ 4b -β”‚ β”‚ β”œβ”€β”€ 4c -β”‚ β”‚ β”œβ”€β”€ 4d -β”‚ β”‚ β”œβ”€β”€ 4e -β”‚ β”‚ β”œβ”€β”€ 4f -β”‚ β”‚ β”œβ”€β”€ 50 -β”‚ β”‚ β”œβ”€β”€ 51 -β”‚ β”‚ β”œβ”€β”€ 52 -β”‚ β”‚ β”œβ”€β”€ 55 -β”‚ β”‚ β”œβ”€β”€ 56 -β”‚ β”‚ β”œβ”€β”€ 57 -β”‚ β”‚ β”œβ”€β”€ 58 -β”‚ β”‚ β”œβ”€β”€ 59 -β”‚ β”‚ β”œβ”€β”€ 5a -β”‚ β”‚ β”œβ”€β”€ 5b -β”‚ β”‚ β”œβ”€β”€ 5c -β”‚ β”‚ β”œβ”€β”€ 5d -β”‚ β”‚ β”œβ”€β”€ 5e -β”‚ β”‚ β”œβ”€β”€ 5f -β”‚ β”‚ β”œβ”€β”€ 60 -β”‚ β”‚ β”œβ”€β”€ 61 -β”‚ β”‚ β”œβ”€β”€ 62 -β”‚ β”‚ β”œβ”€β”€ 63 -β”‚ β”‚ β”œβ”€β”€ 65 -β”‚ β”‚ β”œβ”€β”€ 67 -β”‚ β”‚ β”œβ”€β”€ 69 -β”‚ β”‚ β”œβ”€β”€ 6b -β”‚ β”‚ β”œβ”€β”€ 6c -β”‚ β”‚ β”œβ”€β”€ 6d -β”‚ β”‚ β”œβ”€β”€ 6e -β”‚ β”‚ β”œβ”€β”€ 70 -β”‚ β”‚ β”œβ”€β”€ 71 -β”‚ β”‚ β”œβ”€β”€ 74 -β”‚ β”‚ β”œβ”€β”€ 75 -β”‚ β”‚ β”œβ”€β”€ 76 -β”‚ β”‚ β”œβ”€β”€ 77 -β”‚ β”‚ β”œβ”€β”€ 79 -β”‚ β”‚ β”œβ”€β”€ 7b -β”‚ β”‚ β”œβ”€β”€ 7c -β”‚ β”‚ β”œβ”€β”€ 7d -β”‚ β”‚ β”œβ”€β”€ 7f -β”‚ β”‚ β”œβ”€β”€ 80 -β”‚ β”‚ β”œβ”€β”€ 81 -β”‚ β”‚ β”œβ”€β”€ 82 -β”‚ β”‚ β”œβ”€β”€ 83 -β”‚ β”‚ β”œβ”€β”€ 84 -β”‚ β”‚ β”œβ”€β”€ 85 -β”‚ β”‚ β”œβ”€β”€ 86 -β”‚ β”‚ β”œβ”€β”€ 87 -β”‚ β”‚ β”œβ”€β”€ 89 -β”‚ β”‚ β”œβ”€β”€ 8a -β”‚ β”‚ β”œβ”€β”€ 8b -β”‚ β”‚ β”œβ”€β”€ 8c -β”‚ β”‚ β”œβ”€β”€ 8d -β”‚ β”‚ β”œβ”€β”€ 90 -β”‚ β”‚ β”œβ”€β”€ 92 -β”‚ β”‚ β”œβ”€β”€ 94 -β”‚ β”‚ β”œβ”€β”€ 95 -β”‚ β”‚ β”œβ”€β”€ 97 -β”‚ β”‚ β”œβ”€β”€ 98 -β”‚ β”‚ β”œβ”€β”€ 99 -β”‚ β”‚ β”œβ”€β”€ 9a -β”‚ β”‚ β”œβ”€β”€ 9b -β”‚ β”‚ β”œβ”€β”€ 9c -β”‚ β”‚ β”œβ”€β”€ 9d -β”‚ β”‚ β”œβ”€β”€ a0 -β”‚ β”‚ β”œβ”€β”€ a1 -β”‚ β”‚ β”œβ”€β”€ a2 -β”‚ β”‚ β”œβ”€β”€ a3 -β”‚ β”‚ β”œβ”€β”€ a4 -β”‚ β”‚ β”œβ”€β”€ a5 -β”‚ β”‚ β”œβ”€β”€ a6 -β”‚ β”‚ β”œβ”€β”€ a7 -β”‚ β”‚ β”œβ”€β”€ a8 -β”‚ β”‚ β”œβ”€β”€ a9 -β”‚ β”‚ β”œβ”€β”€ aa -β”‚ β”‚ β”œβ”€β”€ ab -β”‚ β”‚ β”œβ”€β”€ ac -β”‚ β”‚ β”œβ”€β”€ ad -β”‚ β”‚ β”œβ”€β”€ ae -β”‚ β”‚ β”œβ”€β”€ af -β”‚ β”‚ β”œβ”€β”€ b0 -β”‚ β”‚ β”œβ”€β”€ b1 -β”‚ β”‚ β”œβ”€β”€ b2 -β”‚ β”‚ β”œβ”€β”€ b3 -β”‚ β”‚ β”œβ”€β”€ b4 -β”‚ β”‚ β”œβ”€β”€ b5 -β”‚ β”‚ β”œβ”€β”€ b6 -β”‚ β”‚ β”œβ”€β”€ b8 -β”‚ β”‚ β”œβ”€β”€ b9 -β”‚ β”‚ β”œβ”€β”€ ba -β”‚ β”‚ β”œβ”€β”€ bb -β”‚ β”‚ β”œβ”€β”€ bc -β”‚ β”‚ β”œβ”€β”€ bd -β”‚ β”‚ β”œβ”€β”€ bf -β”‚ β”‚ β”œβ”€β”€ c0 -β”‚ β”‚ β”œβ”€β”€ c3 -β”‚ β”‚ β”œβ”€β”€ c4 -β”‚ β”‚ β”œβ”€β”€ c5 -β”‚ β”‚ β”œβ”€β”€ c6 -β”‚ β”‚ β”œβ”€β”€ c7 -β”‚ β”‚ β”œβ”€β”€ c9 -β”‚ β”‚ β”œβ”€β”€ cc -β”‚ β”‚ β”œβ”€β”€ cd -β”‚ β”‚ β”œβ”€β”€ ce -β”‚ β”‚ β”œβ”€β”€ cf -β”‚ β”‚ β”œβ”€β”€ d1 -β”‚ β”‚ β”œβ”€β”€ d3 -β”‚ β”‚ β”œβ”€β”€ d4 -β”‚ β”‚ β”œβ”€β”€ d5 -β”‚ β”‚ β”œβ”€β”€ d6 -β”‚ β”‚ β”œβ”€β”€ d7 -β”‚ β”‚ β”œβ”€β”€ d8 -β”‚ β”‚ β”œβ”€β”€ d9 -β”‚ β”‚ β”œβ”€β”€ da -β”‚ β”‚ β”œβ”€β”€ db -β”‚ β”‚ β”œβ”€β”€ dc -β”‚ β”‚ β”œβ”€β”€ dd -β”‚ β”‚ β”œβ”€β”€ de -β”‚ β”‚ β”œβ”€β”€ df -β”‚ β”‚ β”œβ”€β”€ e0 -β”‚ β”‚ β”œβ”€β”€ e1 -β”‚ β”‚ β”œβ”€β”€ e2 -β”‚ β”‚ β”œβ”€β”€ e3 -β”‚ β”‚ β”œβ”€β”€ e4 -β”‚ β”‚ β”œβ”€β”€ e5 -β”‚ β”‚ β”œβ”€β”€ e6 -β”‚ β”‚ β”œβ”€β”€ e7 -β”‚ β”‚ β”œβ”€β”€ e8 -β”‚ β”‚ β”œβ”€β”€ e9 -β”‚ β”‚ β”œβ”€β”€ ec -β”‚ β”‚ β”œβ”€β”€ ed -β”‚ β”‚ β”œβ”€β”€ ee -β”‚ β”‚ β”œβ”€β”€ ef -β”‚ β”‚ β”œβ”€β”€ f1 -β”‚ β”‚ β”œβ”€β”€ f2 -β”‚ β”‚ β”œβ”€β”€ f3 -β”‚ β”‚ β”œβ”€β”€ f5 -β”‚ β”‚ β”œβ”€β”€ f6 -β”‚ β”‚ β”œβ”€β”€ f7 -β”‚ β”‚ β”œβ”€β”€ f9 -β”‚ β”‚ β”œβ”€β”€ fa -β”‚ β”‚ β”œβ”€β”€ fb -β”‚ β”‚ β”œβ”€β”€ fc -β”‚ β”‚ β”œβ”€β”€ fd -β”‚ β”‚ β”œβ”€β”€ ff -β”‚ β”‚ β”œβ”€β”€ info -β”‚ β”‚ └── pack -β”‚ └── refs -β”‚ β”œβ”€β”€ heads -β”‚ β”œβ”€β”€ remotes -β”‚ └── tags -β”œβ”€β”€ .gitignore -β”œβ”€β”€ .python-version -β”œβ”€β”€ .venv -β”‚ β”œβ”€β”€ .gitignore -β”‚ β”œβ”€β”€ .lock -β”‚ β”œβ”€β”€ CACHEDIR.TAG -β”‚ β”œβ”€β”€ Lib -β”‚ β”‚ └── site-packages -β”‚ β”œβ”€β”€ Scripts -β”‚ β”‚ β”œβ”€β”€ activate -β”‚ β”‚ β”œβ”€β”€ activate.bat -β”‚ β”‚ β”œβ”€β”€ activate.csh -β”‚ β”‚ β”œβ”€β”€ activate.fish -β”‚ β”‚ β”œβ”€β”€ activate.nu -β”‚ β”‚ β”œβ”€β”€ activate.ps1 -β”‚ β”‚ β”œβ”€β”€ activate_this.py -β”‚ β”‚ β”œβ”€β”€ deactivate.bat -β”‚ β”‚ β”œβ”€β”€ debugpy-adapter.exe -β”‚ β”‚ β”œβ”€β”€ debugpy.exe -β”‚ β”‚ β”œβ”€β”€ distro.exe -β”‚ β”‚ β”œβ”€β”€ dotenv.exe -β”‚ β”‚ β”œβ”€β”€ f2py.exe -β”‚ β”‚ β”œβ”€β”€ fastapi.exe -β”‚ β”‚ β”œβ”€β”€ httpx.exe -β”‚ β”‚ β”œβ”€β”€ huggingface-cli.exe -β”‚ β”‚ β”œβ”€β”€ ipython.exe -β”‚ β”‚ β”œβ”€β”€ ipython3.exe -β”‚ β”‚ β”œβ”€β”€ isympy.exe -β”‚ β”‚ β”œβ”€β”€ jlpm.exe -β”‚ β”‚ β”œβ”€β”€ jsonpointer -β”‚ β”‚ β”œβ”€β”€ jsonschema.exe -β”‚ β”‚ β”œβ”€β”€ jupyter-console.exe -β”‚ β”‚ β”œβ”€β”€ jupyter-dejavu.exe -β”‚ β”‚ β”œβ”€β”€ jupyter-events.exe -β”‚ β”‚ β”œβ”€β”€ jupyter-execute.exe -β”‚ β”‚ β”œβ”€β”€ jupyter-kernel.exe -β”‚ β”‚ β”œβ”€β”€ jupyter-kernelspec.exe -β”‚ β”‚ β”œβ”€β”€ jupyter-lab.exe -β”‚ β”‚ β”œβ”€β”€ jupyter-labextension.exe -β”‚ β”‚ β”œβ”€β”€ jupyter-labhub.exe -β”‚ β”‚ β”œβ”€β”€ jupyter-migrate.exe -β”‚ β”‚ β”œβ”€β”€ jupyter-nbconvert.exe -β”‚ β”‚ β”œβ”€β”€ jupyter-notebook.exe -β”‚ β”‚ β”œβ”€β”€ jupyter-run.exe -β”‚ β”‚ β”œβ”€β”€ jupyter-server.exe -β”‚ β”‚ β”œβ”€β”€ jupyter-troubleshoot.exe -β”‚ β”‚ β”œβ”€β”€ jupyter-trust.exe -β”‚ β”‚ β”œβ”€β”€ jupyter.exe -β”‚ β”‚ β”œβ”€β”€ markdown-it.exe -β”‚ β”‚ β”œβ”€β”€ mcp.exe -β”‚ β”‚ β”œβ”€β”€ normalizer.exe -β”‚ β”‚ β”œβ”€β”€ numpy-config.exe -β”‚ β”‚ β”œβ”€β”€ openai.exe -β”‚ β”‚ β”œβ”€β”€ petname.exe -β”‚ β”‚ β”œβ”€β”€ pip.exe -β”‚ β”‚ β”œβ”€β”€ pip3.11.exe -β”‚ β”‚ β”œβ”€β”€ pip3.exe -β”‚ β”‚ β”œβ”€β”€ pybabel.exe -β”‚ β”‚ β”œβ”€β”€ pydoc.bat -β”‚ β”‚ β”œβ”€β”€ pygmentize.exe -β”‚ β”‚ β”œβ”€β”€ pyjson5.exe -β”‚ β”‚ β”œβ”€β”€ python.exe -β”‚ β”‚ β”œβ”€β”€ pythonw.exe -β”‚ β”‚ β”œβ”€β”€ pywin32_postinstall.exe -β”‚ β”‚ β”œβ”€β”€ pywin32_postinstall.py -β”‚ β”‚ β”œβ”€β”€ pywin32_testall.exe -β”‚ β”‚ β”œβ”€β”€ pywin32_testall.py -β”‚ β”‚ β”œβ”€β”€ send2trash.exe -β”‚ β”‚ β”œβ”€β”€ torchfrtrace.exe -β”‚ β”‚ β”œβ”€β”€ torchrun.exe -β”‚ β”‚ β”œβ”€β”€ tqdm.exe -β”‚ β”‚ β”œβ”€β”€ transformers-cli.exe -β”‚ β”‚ β”œβ”€β”€ typer.exe -β”‚ β”‚ β”œβ”€β”€ uvicorn.exe -β”‚ β”‚ └── wsdump.exe -β”‚ β”œβ”€β”€ etc -β”‚ β”‚ └── jupyter -β”‚ β”œβ”€β”€ include -β”‚ β”‚ └── site -β”‚ β”œβ”€β”€ pyvenv.cfg -β”‚ └── share -β”‚ β”œβ”€β”€ applications -β”‚ β”œβ”€β”€ icons -β”‚ β”œβ”€β”€ jupyter -β”‚ └── man -β”œβ”€β”€ Apikeys.ipynb -β”œβ”€β”€ Apikeys_embedding.ipynb -β”œβ”€β”€ Credenciales.ipynb -β”œβ”€β”€ Encriptacion.ipynb -β”œβ”€β”€ README.md -β”œβ”€β”€ backend +E:\Fitz_Studio\backend +β”œβ”€β”€ __init__.py +β”œβ”€β”€ __pycache__ +β”‚ β”œβ”€β”€ __init__.cpython-311.pyc +β”‚ β”œβ”€β”€ main.cpython-311.pyc +β”‚ └── router_v1.cpython-311.pyc +β”œβ”€β”€ db β”‚ β”œβ”€β”€ __init__.py β”‚ β”œβ”€β”€ __pycache__ β”‚ β”‚ β”œβ”€β”€ __init__.cpython-311.pyc -β”‚ β”‚ └── main.cpython-311.pyc -β”‚ β”œβ”€β”€ api -β”‚ β”‚ β”œβ”€β”€ __init__.py +β”‚ β”‚ └── conexion.cpython-311.pyc +β”‚ └── conexion.py +β”œβ”€β”€ deps +β”‚ β”œβ”€β”€ __init__.py +β”‚ └── auth.py +β”œβ”€β”€ domains +β”‚ β”œβ”€β”€ experiments β”‚ β”‚ β”œβ”€β”€ __pycache__ -β”‚ β”‚ └── v1 -β”‚ β”œβ”€β”€ db -β”‚ β”‚ β”œβ”€β”€ __init__.py -β”‚ β”‚ └── conexion.py -β”‚ β”œβ”€β”€ deps -β”‚ β”‚ β”œβ”€β”€ __init__.py -β”‚ β”‚ └── auth.py -β”‚ └── main.py -β”œβ”€β”€ config -β”‚ └── .env -β”œβ”€β”€ data -β”‚ β”œβ”€β”€ files -β”‚ β”‚ β”œβ”€β”€ pdf -β”‚ β”‚ └── txt -β”‚ β”œβ”€β”€ postgresql -β”‚ β”‚ β”œβ”€β”€ docker-compose.yml -β”‚ β”‚ └── pgdata -β”‚ └── sqlite -β”œβ”€β”€ entrypoint -β”‚ β”œβ”€β”€ __init__.py -β”‚ β”œβ”€β”€ __pycache__ -β”‚ β”‚ β”œβ”€β”€ __init__.cpython-311.pyc -β”‚ β”‚ └── init_db.cpython-311.pyc -β”‚ β”œβ”€β”€ add_to_pythonpath.ps1 -β”‚ └── init_db.py -β”œβ”€β”€ frontend -β”‚ β”œβ”€β”€ .github -β”‚ β”‚ └── workflows -β”‚ β”œβ”€β”€ .gitignore -β”‚ β”œβ”€β”€ .nvmrc -β”‚ β”œβ”€β”€ .prettierrc.mjs -β”‚ β”œβ”€β”€ .storybook -β”‚ β”‚ β”œβ”€β”€ main.ts -β”‚ β”‚ └── preview.tsx -β”‚ β”œβ”€β”€ .stylelintignore -β”‚ β”œβ”€β”€ .stylelintrc.json -β”‚ β”œβ”€β”€ .yarn -β”‚ β”‚ └── releases -β”‚ β”œβ”€β”€ .yarnrc.yml -β”‚ β”œβ”€β”€ README.md -β”‚ β”œβ”€β”€ eslint.config.js -β”‚ β”œβ”€β”€ index.html -β”‚ β”œβ”€β”€ node_modules -β”‚ β”‚ β”œβ”€β”€ .bin -β”‚ β”‚ β”œβ”€β”€ .package-lock.json -β”‚ β”‚ β”œβ”€β”€ .vite -β”‚ β”‚ β”œβ”€β”€ .vite-temp -β”‚ β”‚ β”œβ”€β”€ @adobe -β”‚ β”‚ β”œβ”€β”€ @ampproject -β”‚ β”‚ β”œβ”€β”€ @asamuzakjp -β”‚ β”‚ β”œβ”€β”€ @babel -β”‚ β”‚ β”œβ”€β”€ @csstools -β”‚ β”‚ β”œβ”€β”€ @dimforge -β”‚ β”‚ β”œβ”€β”€ @dual-bundle -β”‚ β”‚ β”œβ”€β”€ @esbuild -β”‚ β”‚ β”œβ”€β”€ @eslint -β”‚ β”‚ β”œβ”€β”€ @eslint-community -β”‚ β”‚ β”œβ”€β”€ @floating-ui -β”‚ β”‚ β”œβ”€β”€ @humanfs -β”‚ β”‚ β”œβ”€β”€ @humanwhocodes -β”‚ β”‚ β”œβ”€β”€ @ianvs -β”‚ β”‚ β”œβ”€β”€ @isaacs -β”‚ β”‚ β”œβ”€β”€ @joshwooding -β”‚ β”‚ β”œβ”€β”€ @jridgewell -β”‚ β”‚ β”œβ”€β”€ @keyv -β”‚ β”‚ β”œβ”€β”€ @mantine -β”‚ β”‚ β”œβ”€β”€ @modelcontextprotocol -β”‚ β”‚ β”œβ”€β”€ @nodelib -β”‚ β”‚ β”œβ”€β”€ @pkgjs -β”‚ β”‚ β”œβ”€β”€ @react-three -β”‚ β”‚ β”œβ”€β”€ @rollup -β”‚ β”‚ β”œβ”€β”€ @storybook -β”‚ β”‚ β”œβ”€β”€ @svgr -β”‚ β”‚ β”œβ”€β”€ @tabler -β”‚ β”‚ β”œβ”€β”€ @testing-library -β”‚ β”‚ β”œβ”€β”€ @tweenjs -β”‚ β”‚ β”œβ”€β”€ @types -β”‚ β”‚ β”œβ”€β”€ @typescript-eslint -β”‚ β”‚ β”œβ”€β”€ @vitejs -β”‚ β”‚ β”œβ”€β”€ @vitest -β”‚ β”‚ β”œβ”€β”€ @webgpu -β”‚ β”‚ β”œβ”€β”€ accepts -β”‚ β”‚ β”œβ”€β”€ acorn -β”‚ β”‚ β”œβ”€β”€ acorn-jsx -β”‚ β”‚ β”œβ”€β”€ agent-base -β”‚ β”‚ β”œβ”€β”€ ajv -β”‚ β”‚ β”œβ”€β”€ ansi-regex -β”‚ β”‚ β”œβ”€β”€ ansi-styles -β”‚ β”‚ β”œβ”€β”€ argparse -β”‚ β”‚ β”œβ”€β”€ aria-query -β”‚ β”‚ β”œβ”€β”€ array-buffer-byte-length -β”‚ β”‚ β”œβ”€β”€ array-includes -β”‚ β”‚ β”œβ”€β”€ array-union -β”‚ β”‚ β”œβ”€β”€ array.prototype.findlast -β”‚ β”‚ β”œβ”€β”€ array.prototype.flat -β”‚ β”‚ β”œβ”€β”€ array.prototype.flatmap -β”‚ β”‚ β”œβ”€β”€ array.prototype.tosorted -β”‚ β”‚ β”œβ”€β”€ arraybuffer.prototype.slice -β”‚ β”‚ β”œβ”€β”€ assertion-error -β”‚ β”‚ β”œβ”€β”€ ast-types -β”‚ β”‚ β”œβ”€β”€ ast-types-flow -β”‚ β”‚ β”œβ”€β”€ astral-regex -β”‚ β”‚ β”œβ”€β”€ async-function -β”‚ β”‚ β”œβ”€β”€ available-typed-arrays -β”‚ β”‚ β”œβ”€β”€ axe-core -β”‚ β”‚ β”œβ”€β”€ axobject-query -β”‚ β”‚ β”œβ”€β”€ balanced-match -β”‚ β”‚ β”œβ”€β”€ base64-js -β”‚ β”‚ β”œβ”€β”€ better-opn -β”‚ β”‚ β”œβ”€β”€ body-parser -β”‚ β”‚ β”œβ”€β”€ brace-expansion -β”‚ β”‚ β”œβ”€β”€ braces -β”‚ β”‚ β”œβ”€β”€ browser-assert -β”‚ β”‚ β”œβ”€β”€ browserslist -β”‚ β”‚ β”œβ”€β”€ buffer -β”‚ β”‚ β”œβ”€β”€ bytes -β”‚ β”‚ β”œβ”€β”€ cac -β”‚ β”‚ β”œβ”€β”€ cacheable -β”‚ β”‚ β”œβ”€β”€ call-bind -β”‚ β”‚ β”œβ”€β”€ call-bind-apply-helpers -β”‚ β”‚ β”œβ”€β”€ call-bound -β”‚ β”‚ β”œβ”€β”€ callsites -β”‚ β”‚ β”œβ”€β”€ camelcase -β”‚ β”‚ β”œβ”€β”€ camelcase-css -β”‚ β”‚ β”œβ”€β”€ caniuse-lite -β”‚ β”‚ β”œβ”€β”€ chai -β”‚ β”‚ β”œβ”€β”€ chalk -β”‚ β”‚ β”œβ”€β”€ check-error -β”‚ β”‚ β”œβ”€β”€ clsx -β”‚ β”‚ β”œβ”€β”€ color-convert -β”‚ β”‚ β”œβ”€β”€ color-name -β”‚ β”‚ β”œβ”€β”€ colord -β”‚ β”‚ β”œβ”€β”€ concat-map -β”‚ β”‚ β”œβ”€β”€ content-disposition -β”‚ β”‚ β”œβ”€β”€ content-type -β”‚ β”‚ β”œβ”€β”€ convert-source-map -β”‚ β”‚ β”œβ”€β”€ cookie -β”‚ β”‚ β”œβ”€β”€ cookie-signature -β”‚ β”‚ β”œβ”€β”€ cors -β”‚ β”‚ β”œβ”€β”€ cosmiconfig -β”‚ β”‚ β”œβ”€β”€ cross-spawn -β”‚ β”‚ β”œβ”€β”€ css-functions-list -β”‚ β”‚ β”œβ”€β”€ css-tree -β”‚ β”‚ β”œβ”€β”€ css.escape -β”‚ β”‚ β”œβ”€β”€ cssesc -β”‚ β”‚ β”œβ”€β”€ cssstyle -β”‚ β”‚ β”œβ”€β”€ csstype -β”‚ β”‚ β”œβ”€β”€ damerau-levenshtein -β”‚ β”‚ β”œβ”€β”€ data-urls -β”‚ β”‚ β”œβ”€β”€ data-view-buffer -β”‚ β”‚ β”œβ”€β”€ data-view-byte-length -β”‚ β”‚ β”œβ”€β”€ data-view-byte-offset -β”‚ β”‚ β”œβ”€β”€ debug -β”‚ β”‚ β”œβ”€β”€ decimal.js -β”‚ β”‚ β”œβ”€β”€ deep-eql -β”‚ β”‚ β”œβ”€β”€ deep-is -β”‚ β”‚ β”œβ”€β”€ define-data-property -β”‚ β”‚ β”œβ”€β”€ define-lazy-prop -β”‚ β”‚ β”œβ”€β”€ define-properties -β”‚ β”‚ β”œβ”€β”€ depd -β”‚ β”‚ β”œβ”€β”€ dequal -β”‚ β”‚ β”œβ”€β”€ detect-node-es -β”‚ β”‚ β”œβ”€β”€ dir-glob -β”‚ β”‚ β”œβ”€β”€ doctrine -β”‚ β”‚ β”œβ”€β”€ dom-accessibility-api -β”‚ β”‚ β”œβ”€β”€ dot-case -β”‚ β”‚ β”œβ”€β”€ dunder-proto -β”‚ β”‚ β”œβ”€β”€ eastasianwidth -β”‚ β”‚ β”œβ”€β”€ ee-first -β”‚ β”‚ β”œβ”€β”€ electron-to-chromium -β”‚ β”‚ β”œβ”€β”€ emoji-regex -β”‚ β”‚ β”œβ”€β”€ encodeurl -β”‚ β”‚ β”œβ”€β”€ entities -β”‚ β”‚ β”œβ”€β”€ env-paths -β”‚ β”‚ β”œβ”€β”€ error-ex -β”‚ β”‚ β”œβ”€β”€ es-abstract -β”‚ β”‚ β”œβ”€β”€ es-define-property -β”‚ β”‚ β”œβ”€β”€ es-errors -β”‚ β”‚ β”œβ”€β”€ es-iterator-helpers -β”‚ β”‚ β”œβ”€β”€ es-module-lexer -β”‚ β”‚ β”œβ”€β”€ es-object-atoms -β”‚ β”‚ β”œβ”€β”€ es-set-tostringtag -β”‚ β”‚ β”œβ”€β”€ es-shim-unscopables -β”‚ β”‚ β”œβ”€β”€ es-to-primitive -β”‚ β”‚ β”œβ”€β”€ esbuild -β”‚ β”‚ β”œβ”€β”€ esbuild-register -β”‚ β”‚ β”œβ”€β”€ escalade -β”‚ β”‚ β”œβ”€β”€ escape-html -β”‚ β”‚ β”œβ”€β”€ escape-string-regexp -β”‚ β”‚ β”œβ”€β”€ eslint -β”‚ β”‚ β”œβ”€β”€ eslint-config-mantine -β”‚ β”‚ β”œβ”€β”€ eslint-plugin-jsx-a11y -β”‚ β”‚ β”œβ”€β”€ eslint-plugin-react -β”‚ β”‚ β”œβ”€β”€ eslint-scope -β”‚ β”‚ β”œβ”€β”€ eslint-visitor-keys -β”‚ β”‚ β”œβ”€β”€ espree -β”‚ β”‚ β”œβ”€β”€ esprima -β”‚ β”‚ β”œβ”€β”€ esquery -β”‚ β”‚ β”œβ”€β”€ esrecurse -β”‚ β”‚ β”œβ”€β”€ estraverse -β”‚ β”‚ β”œβ”€β”€ estree-walker -β”‚ β”‚ β”œβ”€β”€ esutils -β”‚ β”‚ β”œβ”€β”€ etag -β”‚ β”‚ β”œβ”€β”€ eventsource -β”‚ β”‚ β”œβ”€β”€ eventsource-parser -β”‚ β”‚ β”œβ”€β”€ expect-type -β”‚ β”‚ β”œβ”€β”€ express -β”‚ β”‚ β”œβ”€β”€ express-rate-limit -β”‚ β”‚ β”œβ”€β”€ fast-deep-equal -β”‚ β”‚ β”œβ”€β”€ fast-glob -β”‚ β”‚ β”œβ”€β”€ fast-json-stable-stringify -β”‚ β”‚ β”œβ”€β”€ fast-levenshtein -β”‚ β”‚ β”œβ”€β”€ fast-uri -β”‚ β”‚ β”œβ”€β”€ fastest-levenshtein -β”‚ β”‚ β”œβ”€β”€ fastq -β”‚ β”‚ β”œβ”€β”€ fdir -β”‚ β”‚ β”œβ”€β”€ fflate -β”‚ β”‚ β”œβ”€β”€ file-entry-cache -β”‚ β”‚ β”œβ”€β”€ fill-range -β”‚ β”‚ β”œβ”€β”€ finalhandler -β”‚ β”‚ β”œβ”€β”€ find-up -β”‚ β”‚ β”œβ”€β”€ flat-cache -β”‚ β”‚ β”œβ”€β”€ flatted -β”‚ β”‚ β”œβ”€β”€ for-each -β”‚ β”‚ β”œβ”€β”€ foreground-child -β”‚ β”‚ β”œβ”€β”€ forwarded -β”‚ β”‚ β”œβ”€β”€ fresh -β”‚ β”‚ β”œβ”€β”€ function-bind -β”‚ β”‚ β”œβ”€β”€ function.prototype.name -β”‚ β”‚ β”œβ”€β”€ functions-have-names -β”‚ β”‚ β”œβ”€β”€ gensync -β”‚ β”‚ β”œβ”€β”€ get-intrinsic -β”‚ β”‚ β”œβ”€β”€ get-nonce -β”‚ β”‚ β”œβ”€β”€ get-proto -β”‚ β”‚ β”œβ”€β”€ get-symbol-description -β”‚ β”‚ β”œβ”€β”€ glob -β”‚ β”‚ β”œβ”€β”€ glob-parent -β”‚ β”‚ β”œβ”€β”€ global-modules -β”‚ β”‚ β”œβ”€β”€ global-prefix -β”‚ β”‚ β”œβ”€β”€ globals -β”‚ β”‚ β”œβ”€β”€ globalthis -β”‚ β”‚ β”œβ”€β”€ globby -β”‚ β”‚ β”œβ”€β”€ globjoin -β”‚ β”‚ β”œβ”€β”€ globrex -β”‚ β”‚ β”œβ”€β”€ gopd -β”‚ β”‚ β”œβ”€β”€ graphemer -β”‚ β”‚ β”œβ”€β”€ harmony-reflect -β”‚ β”‚ β”œβ”€β”€ has-bigints -β”‚ β”‚ β”œβ”€β”€ has-flag -β”‚ β”‚ β”œβ”€β”€ has-property-descriptors -β”‚ β”‚ β”œβ”€β”€ has-proto -β”‚ β”‚ β”œβ”€β”€ has-symbols -β”‚ β”‚ β”œβ”€β”€ has-tostringtag -β”‚ β”‚ β”œβ”€β”€ hasown -β”‚ β”‚ β”œβ”€β”€ hookified -β”‚ β”‚ β”œβ”€β”€ html-encoding-sniffer -β”‚ β”‚ β”œβ”€β”€ html-tags -β”‚ β”‚ β”œβ”€β”€ http-errors -β”‚ β”‚ β”œβ”€β”€ http-proxy-agent -β”‚ β”‚ β”œβ”€β”€ https-proxy-agent -β”‚ β”‚ β”œβ”€β”€ iconv-lite -β”‚ β”‚ β”œβ”€β”€ identity-obj-proxy -β”‚ β”‚ β”œβ”€β”€ ieee754 -β”‚ β”‚ β”œβ”€β”€ ignore -β”‚ β”‚ β”œβ”€β”€ import-fresh -β”‚ β”‚ β”œβ”€β”€ imurmurhash -β”‚ β”‚ β”œβ”€β”€ indent-string -β”‚ β”‚ β”œβ”€β”€ inherits -β”‚ β”‚ β”œβ”€β”€ ini -β”‚ β”‚ β”œβ”€β”€ internal-slot -β”‚ β”‚ β”œβ”€β”€ ipaddr.js -β”‚ β”‚ β”œβ”€β”€ is-arguments -β”‚ β”‚ β”œβ”€β”€ is-array-buffer -β”‚ β”‚ β”œβ”€β”€ is-arrayish -β”‚ β”‚ β”œβ”€β”€ is-async-function -β”‚ β”‚ β”œβ”€β”€ is-bigint -β”‚ β”‚ β”œβ”€β”€ is-boolean-object -β”‚ β”‚ β”œβ”€β”€ is-callable -β”‚ β”‚ β”œβ”€β”€ is-core-module -β”‚ β”‚ β”œβ”€β”€ is-data-view -β”‚ β”‚ β”œβ”€β”€ is-date-object -β”‚ β”‚ β”œβ”€β”€ is-docker -β”‚ β”‚ β”œβ”€β”€ is-extglob -β”‚ β”‚ β”œβ”€β”€ is-finalizationregistry -β”‚ β”‚ β”œβ”€β”€ is-fullwidth-code-point -β”‚ β”‚ β”œβ”€β”€ is-generator-function -β”‚ β”‚ β”œβ”€β”€ is-glob -β”‚ β”‚ β”œβ”€β”€ is-map -β”‚ β”‚ β”œβ”€β”€ is-number -β”‚ β”‚ β”œβ”€β”€ is-number-object -β”‚ β”‚ β”œβ”€β”€ is-plain-object -β”‚ β”‚ β”œβ”€β”€ is-potential-custom-element-name -β”‚ β”‚ β”œβ”€β”€ is-promise -β”‚ β”‚ β”œβ”€β”€ is-regex -β”‚ β”‚ β”œβ”€β”€ is-set -β”‚ β”‚ β”œβ”€β”€ is-shared-array-buffer -β”‚ β”‚ β”œβ”€β”€ is-string -β”‚ β”‚ β”œβ”€β”€ is-symbol -β”‚ β”‚ β”œβ”€β”€ is-typed-array -β”‚ β”‚ β”œβ”€β”€ is-weakmap -β”‚ β”‚ β”œβ”€β”€ is-weakref -β”‚ β”‚ β”œβ”€β”€ is-weakset -β”‚ β”‚ β”œβ”€β”€ is-wsl -β”‚ β”‚ β”œβ”€β”€ isarray -β”‚ β”‚ β”œβ”€β”€ isexe -β”‚ β”‚ β”œβ”€β”€ iterator.prototype -β”‚ β”‚ β”œβ”€β”€ its-fine -β”‚ β”‚ β”œβ”€β”€ jackspeak -β”‚ β”‚ β”œβ”€β”€ js-tokens -β”‚ β”‚ β”œβ”€β”€ js-yaml -β”‚ β”‚ β”œβ”€β”€ jsdoc-type-pratt-parser -β”‚ β”‚ β”œβ”€β”€ jsdom -β”‚ β”‚ β”œβ”€β”€ jsesc -β”‚ β”‚ β”œβ”€β”€ json-buffer -β”‚ β”‚ β”œβ”€β”€ json-parse-even-better-errors -β”‚ β”‚ β”œβ”€β”€ json-schema-traverse -β”‚ β”‚ β”œβ”€β”€ json-stable-stringify-without-jsonify -β”‚ β”‚ β”œβ”€β”€ json5 -β”‚ β”‚ β”œβ”€β”€ jsx-ast-utils -β”‚ β”‚ β”œβ”€β”€ keyv -β”‚ β”‚ β”œβ”€β”€ kind-of -β”‚ β”‚ β”œβ”€β”€ known-css-properties -β”‚ β”‚ β”œβ”€β”€ language-subtag-registry -β”‚ β”‚ β”œβ”€β”€ language-tags -β”‚ β”‚ β”œβ”€β”€ levn -β”‚ β”‚ β”œβ”€β”€ lines-and-columns -β”‚ β”‚ β”œβ”€β”€ locate-path -β”‚ β”‚ β”œβ”€β”€ lodash -β”‚ β”‚ β”œβ”€β”€ lodash.merge -β”‚ β”‚ β”œβ”€β”€ lodash.truncate -β”‚ β”‚ β”œβ”€β”€ loose-envify -β”‚ β”‚ β”œβ”€β”€ loupe -β”‚ β”‚ β”œβ”€β”€ lower-case -β”‚ β”‚ β”œβ”€β”€ lru-cache -β”‚ β”‚ β”œβ”€β”€ lz-string -β”‚ β”‚ β”œβ”€β”€ magic-string -β”‚ β”‚ β”œβ”€β”€ map-or-similar -β”‚ β”‚ β”œβ”€β”€ math-intrinsics -β”‚ β”‚ β”œβ”€β”€ mathml-tag-names -β”‚ β”‚ β”œβ”€β”€ mdn-data -β”‚ β”‚ β”œβ”€β”€ media-typer -β”‚ β”‚ β”œβ”€β”€ memoizerific -β”‚ β”‚ β”œβ”€β”€ meow -β”‚ β”‚ β”œβ”€β”€ merge-descriptors -β”‚ β”‚ β”œβ”€β”€ merge2 -β”‚ β”‚ β”œβ”€β”€ meshoptimizer -β”‚ β”‚ β”œβ”€β”€ micromatch -β”‚ β”‚ β”œβ”€β”€ mime-db -β”‚ β”‚ β”œβ”€β”€ mime-types -β”‚ β”‚ β”œβ”€β”€ min-indent -β”‚ β”‚ β”œβ”€β”€ minimatch -β”‚ β”‚ β”œβ”€β”€ minimist -β”‚ β”‚ β”œβ”€β”€ minipass -β”‚ β”‚ β”œβ”€β”€ ms -β”‚ β”‚ β”œβ”€β”€ nanoid -β”‚ β”‚ β”œβ”€β”€ natural-compare -β”‚ β”‚ β”œβ”€β”€ negotiator -β”‚ β”‚ β”œβ”€β”€ no-case -β”‚ β”‚ β”œβ”€β”€ node-releases -β”‚ β”‚ β”œβ”€β”€ normalize-path -β”‚ β”‚ β”œβ”€β”€ nwsapi -β”‚ β”‚ β”œβ”€β”€ object-assign -β”‚ β”‚ β”œβ”€β”€ object-inspect -β”‚ β”‚ β”œβ”€β”€ object-keys -β”‚ β”‚ β”œβ”€β”€ object.assign -β”‚ β”‚ β”œβ”€β”€ object.entries -β”‚ β”‚ β”œβ”€β”€ object.fromentries -β”‚ β”‚ β”œβ”€β”€ object.values -β”‚ β”‚ β”œβ”€β”€ on-finished -β”‚ β”‚ β”œβ”€β”€ once -β”‚ β”‚ β”œβ”€β”€ open -β”‚ β”‚ β”œβ”€β”€ optionator -β”‚ β”‚ β”œβ”€β”€ own-keys -β”‚ β”‚ β”œβ”€β”€ p-limit -β”‚ β”‚ β”œβ”€β”€ p-locate -β”‚ β”‚ β”œβ”€β”€ package-json-from-dist -β”‚ β”‚ β”œβ”€β”€ parent-module -β”‚ β”‚ β”œβ”€β”€ parse-json -β”‚ β”‚ β”œβ”€β”€ parse5 -β”‚ β”‚ β”œβ”€β”€ parseurl -β”‚ β”‚ β”œβ”€β”€ path-exists -β”‚ β”‚ β”œβ”€β”€ path-key -β”‚ β”‚ β”œβ”€β”€ path-parse -β”‚ β”‚ β”œβ”€β”€ path-scurry -β”‚ β”‚ β”œβ”€β”€ path-to-regexp -β”‚ β”‚ β”œβ”€β”€ path-type -β”‚ β”‚ β”œβ”€β”€ pathe -β”‚ β”‚ β”œβ”€β”€ pathval -β”‚ β”‚ β”œβ”€β”€ picocolors -β”‚ β”‚ β”œβ”€β”€ picomatch -β”‚ β”‚ β”œβ”€β”€ pkce-challenge -β”‚ β”‚ β”œβ”€β”€ possible-typed-array-names -β”‚ β”‚ β”œβ”€β”€ postcss -β”‚ β”‚ β”œβ”€β”€ postcss-js -β”‚ β”‚ β”œβ”€β”€ postcss-media-query-parser -β”‚ β”‚ β”œβ”€β”€ postcss-mixins -β”‚ β”‚ β”œβ”€β”€ postcss-nested -β”‚ β”‚ β”œβ”€β”€ postcss-preset-mantine -β”‚ β”‚ β”œβ”€β”€ postcss-resolve-nested-selector -β”‚ β”‚ β”œβ”€β”€ postcss-safe-parser -β”‚ β”‚ β”œβ”€β”€ postcss-scss -β”‚ β”‚ β”œβ”€β”€ postcss-selector-parser -β”‚ β”‚ β”œβ”€β”€ postcss-simple-vars -β”‚ β”‚ β”œβ”€β”€ postcss-value-parser -β”‚ β”‚ β”œβ”€β”€ prelude-ls -β”‚ β”‚ β”œβ”€β”€ prettier -β”‚ β”‚ β”œβ”€β”€ pretty-format -β”‚ β”‚ β”œβ”€β”€ process -β”‚ β”‚ β”œβ”€β”€ prop-types -β”‚ β”‚ β”œβ”€β”€ proxy-addr -β”‚ β”‚ β”œβ”€β”€ punycode -β”‚ β”‚ β”œβ”€β”€ qs -β”‚ β”‚ β”œβ”€β”€ queue-microtask -β”‚ β”‚ β”œβ”€β”€ range-parser -β”‚ β”‚ β”œβ”€β”€ raw-body -β”‚ β”‚ β”œβ”€β”€ re-resizable -β”‚ β”‚ β”œβ”€β”€ react -β”‚ β”‚ β”œβ”€β”€ react-docgen -β”‚ β”‚ β”œβ”€β”€ react-docgen-typescript -β”‚ β”‚ β”œβ”€β”€ react-dom -β”‚ β”‚ β”œβ”€β”€ react-draggable -β”‚ β”‚ β”œβ”€β”€ react-is -β”‚ β”‚ β”œβ”€β”€ react-number-format -β”‚ β”‚ β”œβ”€β”€ react-reconciler -β”‚ β”‚ β”œβ”€β”€ react-refresh -β”‚ β”‚ β”œβ”€β”€ react-remove-scroll -β”‚ β”‚ β”œβ”€β”€ react-remove-scroll-bar -β”‚ β”‚ β”œβ”€β”€ react-rnd -β”‚ β”‚ β”œβ”€β”€ react-router -β”‚ β”‚ β”œβ”€β”€ react-router-dom -β”‚ β”‚ β”œβ”€β”€ react-style-singleton -β”‚ β”‚ β”œβ”€β”€ react-textarea-autosize -β”‚ β”‚ β”œβ”€β”€ react-use-measure -β”‚ β”‚ β”œβ”€β”€ recast -β”‚ β”‚ β”œβ”€β”€ redent -β”‚ β”‚ β”œβ”€β”€ reflect.getprototypeof -β”‚ β”‚ β”œβ”€β”€ regexp.prototype.flags -β”‚ β”‚ β”œβ”€β”€ require-from-string -β”‚ β”‚ β”œβ”€β”€ resolve -β”‚ β”‚ β”œβ”€β”€ resolve-from -β”‚ β”‚ β”œβ”€β”€ reusify -β”‚ β”‚ β”œβ”€β”€ rollup -β”‚ β”‚ β”œβ”€β”€ router -β”‚ β”‚ β”œβ”€β”€ rrweb-cssom -β”‚ β”‚ β”œβ”€β”€ run-parallel -β”‚ β”‚ β”œβ”€β”€ safe-array-concat -β”‚ β”‚ β”œβ”€β”€ safe-buffer -β”‚ β”‚ β”œβ”€β”€ safe-push-apply -β”‚ β”‚ β”œβ”€β”€ safe-regex-test -β”‚ β”‚ β”œβ”€β”€ safer-buffer -β”‚ β”‚ β”œβ”€β”€ saxes -β”‚ β”‚ β”œβ”€β”€ scheduler -β”‚ β”‚ β”œβ”€β”€ semver -β”‚ β”‚ β”œβ”€β”€ send -β”‚ β”‚ β”œβ”€β”€ serve-static -β”‚ β”‚ β”œβ”€β”€ set-cookie-parser -β”‚ β”‚ β”œβ”€β”€ set-function-length -β”‚ β”‚ β”œβ”€β”€ set-function-name -β”‚ β”‚ β”œβ”€β”€ set-proto -β”‚ β”‚ β”œβ”€β”€ setprototypeof -β”‚ β”‚ β”œβ”€β”€ shebang-command -β”‚ β”‚ β”œβ”€β”€ shebang-regex -β”‚ β”‚ β”œβ”€β”€ side-channel -β”‚ β”‚ β”œβ”€β”€ side-channel-list -β”‚ β”‚ β”œβ”€β”€ side-channel-map -β”‚ β”‚ β”œβ”€β”€ side-channel-weakmap -β”‚ β”‚ β”œβ”€β”€ siginfo -β”‚ β”‚ β”œβ”€β”€ signal-exit -β”‚ β”‚ β”œβ”€β”€ slash -β”‚ β”‚ β”œβ”€β”€ slice-ansi -β”‚ β”‚ β”œβ”€β”€ snake-case -β”‚ β”‚ β”œβ”€β”€ source-map -β”‚ β”‚ β”œβ”€β”€ source-map-js -β”‚ β”‚ β”œβ”€β”€ stackback -β”‚ β”‚ β”œβ”€β”€ statuses -β”‚ β”‚ β”œβ”€β”€ std-env -β”‚ β”‚ β”œβ”€β”€ storybook -β”‚ β”‚ β”œβ”€β”€ storybook-dark-mode -β”‚ β”‚ β”œβ”€β”€ string-width -β”‚ β”‚ β”œβ”€β”€ string-width-cjs -β”‚ β”‚ β”œβ”€β”€ string.prototype.includes -β”‚ β”‚ β”œβ”€β”€ string.prototype.matchall -β”‚ β”‚ β”œβ”€β”€ string.prototype.repeat -β”‚ β”‚ β”œβ”€β”€ string.prototype.trim -β”‚ β”‚ β”œβ”€β”€ string.prototype.trimend -β”‚ β”‚ β”œβ”€β”€ string.prototype.trimstart -β”‚ β”‚ β”œβ”€β”€ strip-ansi -β”‚ β”‚ β”œβ”€β”€ strip-ansi-cjs -β”‚ β”‚ β”œβ”€β”€ strip-bom -β”‚ β”‚ β”œβ”€β”€ strip-indent -β”‚ β”‚ β”œβ”€β”€ strip-json-comments -β”‚ β”‚ β”œβ”€β”€ stylelint -β”‚ β”‚ β”œβ”€β”€ stylelint-config-recommended -β”‚ β”‚ β”œβ”€β”€ stylelint-config-recommended-scss -β”‚ β”‚ β”œβ”€β”€ stylelint-config-standard -β”‚ β”‚ β”œβ”€β”€ stylelint-config-standard-scss -β”‚ β”‚ β”œβ”€β”€ stylelint-scss -β”‚ β”‚ β”œβ”€β”€ sugarss -β”‚ β”‚ β”œβ”€β”€ supports-color -β”‚ β”‚ β”œβ”€β”€ supports-hyperlinks -β”‚ β”‚ β”œβ”€β”€ supports-preserve-symlinks-flag -β”‚ β”‚ β”œβ”€β”€ suspend-react -β”‚ β”‚ β”œβ”€β”€ svg-parser -β”‚ β”‚ β”œβ”€β”€ svg-tags -β”‚ β”‚ β”œβ”€β”€ symbol-tree -β”‚ β”‚ β”œβ”€β”€ tabbable -β”‚ β”‚ β”œβ”€β”€ table -β”‚ β”‚ β”œβ”€β”€ three -β”‚ β”‚ β”œβ”€β”€ tiny-invariant -β”‚ β”‚ β”œβ”€β”€ tinybench -β”‚ β”‚ β”œβ”€β”€ tinyexec -β”‚ β”‚ β”œβ”€β”€ tinyglobby -β”‚ β”‚ β”œβ”€β”€ tinypool -β”‚ β”‚ β”œβ”€β”€ tinyrainbow -β”‚ β”‚ β”œβ”€β”€ tinyspy -β”‚ β”‚ β”œβ”€β”€ tldts -β”‚ β”‚ β”œβ”€β”€ tldts-core -β”‚ β”‚ β”œβ”€β”€ to-regex-range -β”‚ β”‚ β”œβ”€β”€ toidentifier -β”‚ β”‚ β”œβ”€β”€ tough-cookie -β”‚ β”‚ β”œβ”€β”€ tr46 -β”‚ β”‚ β”œβ”€β”€ ts-api-utils -β”‚ β”‚ β”œβ”€β”€ ts-dedent -β”‚ β”‚ β”œβ”€β”€ tsconfck -β”‚ β”‚ β”œβ”€β”€ tsconfig-paths -β”‚ β”‚ β”œβ”€β”€ tslib -β”‚ β”‚ β”œβ”€β”€ turbo-stream -β”‚ β”‚ β”œβ”€β”€ type-check -β”‚ β”‚ β”œβ”€β”€ type-fest -β”‚ β”‚ β”œβ”€β”€ type-is -β”‚ β”‚ β”œβ”€β”€ typed-array-buffer -β”‚ β”‚ β”œβ”€β”€ typed-array-byte-length -β”‚ β”‚ β”œβ”€β”€ typed-array-byte-offset -β”‚ β”‚ β”œβ”€β”€ typed-array-length -β”‚ β”‚ β”œβ”€β”€ typescript -β”‚ β”‚ β”œβ”€β”€ typescript-eslint -β”‚ β”‚ β”œβ”€β”€ unbox-primitive -β”‚ β”‚ β”œβ”€β”€ undici-types -β”‚ β”‚ β”œβ”€β”€ unpipe -β”‚ β”‚ β”œβ”€β”€ unplugin -β”‚ β”‚ β”œβ”€β”€ update-browserslist-db -β”‚ β”‚ β”œβ”€β”€ uri-js -β”‚ β”‚ β”œβ”€β”€ use-callback-ref -β”‚ β”‚ β”œβ”€β”€ use-composed-ref -β”‚ β”‚ β”œβ”€β”€ use-isomorphic-layout-effect -β”‚ β”‚ β”œβ”€β”€ use-latest -β”‚ β”‚ β”œβ”€β”€ use-sidecar -β”‚ β”‚ β”œβ”€β”€ use-sync-external-store -β”‚ β”‚ β”œβ”€β”€ util -β”‚ β”‚ β”œβ”€β”€ util-deprecate -β”‚ β”‚ β”œβ”€β”€ vary -β”‚ β”‚ β”œβ”€β”€ vite -β”‚ β”‚ β”œβ”€β”€ vite-node -β”‚ β”‚ β”œβ”€β”€ vite-plugin-svgr -β”‚ β”‚ β”œβ”€β”€ vite-tsconfig-paths -β”‚ β”‚ β”œβ”€β”€ vitest -β”‚ β”‚ β”œβ”€β”€ w3c-xmlserializer -β”‚ β”‚ β”œβ”€β”€ webidl-conversions -β”‚ β”‚ β”œβ”€β”€ webpack-virtual-modules -β”‚ β”‚ β”œβ”€β”€ whatwg-encoding -β”‚ β”‚ β”œβ”€β”€ whatwg-mimetype -β”‚ β”‚ β”œβ”€β”€ whatwg-url -β”‚ β”‚ β”œβ”€β”€ which -β”‚ β”‚ β”œβ”€β”€ which-boxed-primitive -β”‚ β”‚ β”œβ”€β”€ which-builtin-type -β”‚ β”‚ β”œβ”€β”€ which-collection -β”‚ β”‚ β”œβ”€β”€ which-typed-array -β”‚ β”‚ β”œβ”€β”€ why-is-node-running -β”‚ β”‚ β”œβ”€β”€ word-wrap -β”‚ β”‚ β”œβ”€β”€ wrap-ansi -β”‚ β”‚ β”œβ”€β”€ wrap-ansi-cjs -β”‚ β”‚ β”œβ”€β”€ wrappy -β”‚ β”‚ β”œβ”€β”€ write-file-atomic -β”‚ β”‚ β”œβ”€β”€ ws -β”‚ β”‚ β”œβ”€β”€ xml-name-validator -β”‚ β”‚ β”œβ”€β”€ xmlchars -β”‚ β”‚ β”œβ”€β”€ yallist -β”‚ β”‚ β”œβ”€β”€ yocto-queue -β”‚ β”‚ β”œβ”€β”€ zod -β”‚ β”‚ β”œβ”€β”€ zod-to-json-schema -β”‚ β”‚ └── zustand -β”‚ β”œβ”€β”€ package-lock.json -β”‚ β”œβ”€β”€ package.json -β”‚ β”œβ”€β”€ postcss.config.cjs -β”‚ β”œβ”€β”€ src -β”‚ β”‚ β”œβ”€β”€ App.tsx -β”‚ β”‚ β”œβ”€β”€ Router.tsx -β”‚ β”‚ β”œβ”€β”€ assets -β”‚ β”‚ β”œβ”€β”€ components -β”‚ β”‚ β”œβ”€β”€ data -β”‚ β”‚ β”œβ”€β”€ main.tsx -β”‚ β”‚ β”œβ”€β”€ pages -β”‚ β”‚ β”œβ”€β”€ theme.ts -β”‚ β”‚ β”œβ”€β”€ types -β”‚ β”‚ └── vite-env.d.ts -β”‚ β”œβ”€β”€ test-utils -β”‚ β”‚ β”œβ”€β”€ index.ts -β”‚ β”‚ └── render.tsx -β”‚ β”œβ”€β”€ tsconfig.json -β”‚ β”œβ”€β”€ vite.config.js -β”‚ β”œβ”€β”€ vitest.setup.mjs -β”‚ └── yarn.lock -β”œβ”€β”€ github_tutorial.ipynb +β”‚ β”‚ β”œβ”€β”€ charts_examples_endpoint_v1.py +β”‚ β”‚ └── ping_endpoint_v1.py +β”‚ β”œβ”€β”€ llms +β”‚ β”‚ β”œβ”€β”€ __pycache__ +β”‚ β”‚ β”œβ”€β”€ llm_chat_endpoint_v1.py +β”‚ β”‚ └── llm_chat_srvc.py +β”‚ └── text_manager +β”‚ β”œβ”€β”€ __pycache__ +β”‚ β”œβ”€β”€ text_manager_endpoint_v1.py +β”‚ β”œβ”€β”€ text_manager_schema.py +β”‚ └── text_manager_srvc.py β”œβ”€β”€ main.py -β”œβ”€β”€ notebooks -β”‚ └── hacer_script_nombres.ipynb -β”œβ”€β”€ prueba_loop_agente.py -β”œβ”€β”€ prueba_mcp.py -β”œβ”€β”€ pruebas_conceptos -β”‚ β”œβ”€β”€ async -β”‚ β”‚ β”œβ”€β”€ async_con_procesos.py -β”‚ β”‚ β”œβ”€β”€ cliente.py -β”‚ β”‚ β”œβ”€β”€ esperar_await.py -β”‚ β”‚ β”œβ”€β”€ prueba_async.py -β”‚ β”‚ └── server_loop.py -β”‚ β”œβ”€β”€ aΓ±adir_vectores_textos_postgres -β”‚ β”‚ └── pruebas_vectores.ipynb -β”‚ β”œβ”€β”€ duckdb -β”‚ β”‚ β”œβ”€β”€ prueba_duckdb.ipynb -β”‚ β”‚ β”œβ”€β”€ textos_vss.duckdb -β”‚ β”‚ └── textos_vss.duckdb.wal -β”‚ └── postgres_extensions -β”‚ β”œβ”€β”€ Dockerfile -β”‚ β”œβ”€β”€ backup_postgres15.sql -β”‚ β”œβ”€β”€ docker-compose.yml -β”‚ β”œβ”€β”€ init.sql -β”‚ └── pgdata -β”œβ”€β”€ pyproject.toml -β”œβ”€β”€ scripts -β”‚ β”œβ”€β”€ __init_.py -β”‚ β”œβ”€β”€ __pycache__ -β”‚ β”‚ └── prueba_carga_postrgesql.cpython-311.pyc -β”‚ └── datos_para_llms -β”‚ └── generar_tree.py -β”œβ”€β”€ src -β”‚ β”œβ”€β”€ ApiKeys -β”‚ β”‚ β”œβ”€β”€ __init__.py -β”‚ β”‚ β”œβ”€β”€ __pycache__ -β”‚ β”‚ β”œβ”€β”€ openai_apikey.py -β”‚ β”‚ └── openai_apikey_mmr.py -β”‚ β”œβ”€β”€ ConexionApis -β”‚ β”‚ β”œβ”€β”€ OpenAi_conexion.py -β”‚ β”‚ β”œβ”€β”€ __init__.py -β”‚ β”‚ └── __pycache__ -β”‚ β”œβ”€β”€ ConexionSql -β”‚ β”‚ β”œβ”€β”€ Base_conexion.py -β”‚ β”‚ β”œβ”€β”€ Postgres_conexion.py -β”‚ β”‚ β”œβ”€β”€ __init__.py -β”‚ β”‚ └── __pycache__ -β”‚ β”œβ”€β”€ Credenciales -β”‚ β”‚ β”œβ”€β”€ __init__.py -β”‚ β”‚ β”œβ”€β”€ __pycache__ -β”‚ β”‚ β”œβ”€β”€ postgres_credencial.py -β”‚ β”‚ └── postgres_credencial_mmr.py -β”‚ β”œβ”€β”€ Llms -β”‚ β”‚ β”œβ”€β”€ Agente.py -β”‚ β”‚ β”œβ”€β”€ Embedders -β”‚ β”‚ β”œβ”€β”€ MCPs -β”‚ β”‚ β”œβ”€β”€ Memory -β”‚ β”‚ β”œβ”€β”€ Modelos -β”‚ β”‚ β”œβ”€β”€ __init__.py -β”‚ β”‚ └── __pycache__ -β”‚ β”œβ”€β”€ Security -β”‚ β”‚ β”œβ”€β”€ Encriptar.py -β”‚ β”‚ β”œβ”€β”€ GenerarIDs.py -β”‚ β”‚ β”œβ”€β”€ __init__.py -β”‚ β”‚ └── __pycache__ -β”‚ β”œβ”€β”€ TextManager -β”‚ β”‚ β”œβ”€β”€ __init__.py -β”‚ β”‚ β”œβ”€β”€ __pycache__ -β”‚ β”‚ β”œβ”€β”€ biblioteca.py -β”‚ β”‚ β”œβ”€β”€ biblioteca_mmr.py -β”‚ β”‚ β”œβ”€β”€ nota.py -β”‚ β”‚ └── notas_biblioteca_mmr.py -β”‚ β”œβ”€β”€ __init__.py -β”‚ β”œβ”€β”€ __pycache__ -β”‚ β”‚ β”œβ”€β”€ __init__.cpython-311.pyc -β”‚ β”‚ └── base.cpython-311.pyc -β”‚ └── base.py -└── utils - β”œβ”€β”€ Generar_nombres.py - β”œβ”€β”€ __init__.py - └── __pycache__ - β”œβ”€β”€ Generar_nombres.cpython-311.pyc - └── __init__.cpython-311.pyc \ No newline at end of file +└── router_v1.py \ No newline at end of file diff --git a/frontend/src/domains/Llms/Chat/ChatPage.tsx b/frontend/src/domains/Llms/Chat/ChatPage.tsx index b862322..a9312ae 100644 --- a/frontend/src/domains/Llms/Chat/ChatPage.tsx +++ b/frontend/src/domains/Llms/Chat/ChatPage.tsx @@ -1,4 +1,4 @@ -import { useState } from "react"; +import { useState, useRef } from "react"; import { Container, Stack, Paper, ScrollArea, Title } from "@mantine/core"; import { ChatInput } from "./ChatInput"; import { MessageList } from "./MessageList"; @@ -8,19 +8,42 @@ export function ChatPage() { const [messages, setMessages] = useState([ { sender: "bot", content: "Hola, ΒΏen quΓ© puedo ayudarte hoy?" }, ]); + const wsRef = useRef(null); const handleSend = async (content: string) => { const newMessages = [...messages, { sender: "user", content }]; setMessages(newMessages); - const response = await fetch("/api/chat", { - method: "POST", - body: JSON.stringify({ messages: newMessages }), - headers: { "Content-Type": "application/json" }, - }); + let currentResponse = ""; + setMessages((prev) => [...prev, { sender: "bot", content: "" }]); - const data = await response.json(); - setMessages([...newMessages, { sender: "bot", content: data.reply }]); + wsRef.current = new WebSocket("ws://localhost:8000/ws/chat"); + + wsRef.current.onopen = () => { + wsRef.current?.send(JSON.stringify({ prompt: content })); + }; + + wsRef.current.onmessage = (event) => { + const token = event.data; + currentResponse += token; + setMessages((prev) => { + const updated = [...prev]; + updated[updated.length - 1] = { sender: "bot", content: currentResponse }; + return updated; + }); + }; + + wsRef.current.onerror = (err) => { + console.error("WebSocket error:", err); + setMessages((prev) => [ + ...prev.slice(0, -1), + { sender: "bot", content: "⚠️ Error al comunicarse con el servidor." }, + ]); + }; + + wsRef.current.onclose = () => { + wsRef.current = null; + }; }; return ( diff --git a/frontend/src/domains/TextEditor/Editor_Test.tsx b/frontend/src/domains/TextEditor/Editor_Test.tsx index 718dfc0..dbc15c6 100644 --- a/frontend/src/domains/TextEditor/Editor_Test.tsx +++ b/frontend/src/domains/TextEditor/Editor_Test.tsx @@ -2,6 +2,7 @@ import { RichTextEditor } from '@mantine/tiptap'; import { useEditor } from '@tiptap/react'; import StarterKit from '@tiptap/starter-kit'; import '@mantine/tiptap/styles.css'; +import { AppShellWithMenu } from '../FitzStudio/Appshell/Appshell'; export default function EditorTest() { const editor = useEditor({ @@ -10,8 +11,9 @@ export default function EditorTest() { }); return ( +
- {editor && ( + {editor && ( @@ -21,7 +23,10 @@ export default function EditorTest() { + )}
); } + + diff --git a/scripts/datos_para_llms/generar_tree.py b/scripts/datos_para_llms/generar_tree.py index 811233d..ee68f84 100644 --- a/scripts/datos_para_llms/generar_tree.py +++ b/scripts/datos_para_llms/generar_tree.py @@ -27,5 +27,5 @@ def save_tree_to_file(start_path='.', max_depth=2, output_file='tree.txt'): # Ejemplo de uso: # Puedes cambiar estos valores segΓΊn lo necesites -save_tree_to_file(start_path=r'E:\Fitz_Studio', max_depth=3, output_file=r'E:\Fitz_Studio\data\files\txt\tree.txt') +save_tree_to_file(start_path=r'E:\Fitz_Studio\backend', max_depth=3, output_file=r'E:\Fitz_Studio\data\files\txt\tree.txt')