MCPcopy Create free account
hub / github.com/PromtEngineer/localGPT / __init__

Method __init__

backend/database.py:8–18  ·  view source on GitHub ↗
(self, db_path: str = None)

Source from the content-addressed store, hash-verified

6
7class ChatDatabase:
8 def __init__(self, db_path: str = None):
9 if db_path is None:
10 # Auto-detect environment and set appropriate path
11 import os
12 if os.path.exists("/app"): # Docker environment
13 self.db_path = "/app/backend/chat_data.db"
14 else: # Local development environment
15 self.db_path = "backend/chat_data.db"
16 else:
17 self.db_path = db_path
18 self.init_database()
19
20 def init_database(self):
21 """Initialize the SQLite database with required tables"""

Callers

nothing calls this directly

Calls 1

init_databaseMethod · 0.95

Tested by

no test coverage detected