diff --git a/.files/5e7c4a81-1697-47da-a003-d9c7c0a70512/96a093b6-6a00-4f64-9edb-5f0d04a0a417.txt b/.files/332f3b7e-fd00-428b-b4d9-327130a0e2d8/2212451a-6b27-48af-a2cb-ab12ad972ae9.txt similarity index 100% rename from .files/5e7c4a81-1697-47da-a003-d9c7c0a70512/96a093b6-6a00-4f64-9edb-5f0d04a0a417.txt rename to .files/332f3b7e-fd00-428b-b4d9-327130a0e2d8/2212451a-6b27-48af-a2cb-ab12ad972ae9.txt diff --git a/__pycache__/app.cpython-310.pyc b/__pycache__/app.cpython-310.pyc index b98d51a5..cfd1d122 100644 Binary files a/__pycache__/app.cpython-310.pyc and b/__pycache__/app.cpython-310.pyc differ diff --git a/app.py b/app.py index cc52580a..a4c9b99b 100644 --- a/app.py +++ b/app.py @@ -7,6 +7,16 @@ import uuid import ollama from qdrant_client import AsyncQdrantClient from qdrant_client.models import PointStruct, Distance, VectorParams +from chainlit.data.sql_alchemy import SQLAlchemyDataLayer + +# --- CONFIGURAZIONE DATABASE (PostgreSQL) --- +# Assicurati che user/password coincidano con il tuo docker-compose.yml +# Sintassi: postgresql+asyncpg://user:password@host:port/dbname +DATABASE_URL = "postgresql+asyncpg://user:password@postgres:5432/ai_station" + +# Attiviamo il salvataggio su DB +cl.data_layer = SQLAlchemyDataLayer(conn_string=DATABASE_URL) +# - # --- CONFIGURAZIONE HARD-CODED --- OLLAMA_URL = "http://192.168.1.243:11434" diff --git a/requirements.txt b/requirements.txt index d42018e0..90d9ddc9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,3 +3,4 @@ ollama asyncpg psycopg2-binary qdrant-client +sqlalchemy \ No newline at end of file