Update .env.example and backend/models/settings.py

This commit is contained in:
Stan Girard 2024-04-29 10:36:10 +02:00
parent fb3aae27f1
commit 5717fdc1d5
2 changed files with 4 additions and 2 deletions

View File

@ -26,7 +26,7 @@ NEXT_PUBLIC_FRONTEND_URL=http://localhost:*
SUPABASE_URL=http://host.docker.internal:54321
SUPABASE_SERVICE_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6InNlcnZpY2Vfcm9sZSIsImV4cCI6MTk4MzgxMjk5Nn0.EGIM96RAZx35lJzdJsyH-qQwv8Hdp7fsn3W0YpN81IU
PG_DATABASE_URL=notimplementedyet
PG_DATABASE_URL=postgresql://postgres:postgres@host.docker.internal:54322/postgres
ANTHROPIC_API_KEY=null
JWT_SECRET_KEY=super-secret-jwt-token-with-at-least-32-characters-long
AUTHENTICATE=true

View File

@ -3,11 +3,11 @@ from uuid import UUID
from langchain.embeddings.ollama import OllamaEmbeddings
from langchain_openai import OpenAIEmbeddings
from sqlalchemy import Engine, create_engine
from logger import get_logger
from models.databases.supabase.supabase import SupabaseDB
from posthog import Posthog
from pydantic_settings import BaseSettings, SettingsConfigDict
from sqlalchemy import Engine, create_engine
from supabase.client import Client, create_client
from vectorstore.supabase import SupabaseVectorStore
@ -128,6 +128,7 @@ _supabase_client: Optional[Client] = None
_supabase_db: Optional[SupabaseDB] = None
_db_engine: Optional[Engine] = None
def get_pg_database_engine():
global _db_engine
if _db_engine is None:
@ -136,6 +137,7 @@ def get_pg_database_engine():
_db_engine = create_engine(settings.pg_database_url)
return _db_engine
def get_supabase_client() -> Client:
global _supabase_client
if _supabase_client is None: