Initialize the script by installing required packages
()
| 22 | |
| 23 | #pip install dependencies |
| 24 | def init(): |
| 25 | """Initialize the script by installing required packages""" |
| 26 | import subprocess |
| 27 | import sys |
| 28 | |
| 29 | # Install required packages for PostgreSQL |
| 30 | for package in _db_type_packages.get("postgres", []): |
| 31 | subprocess.check_call([sys.executable, "-m", "pip", "install", package]) |
| 32 | _db_type_packages = { |
| 33 | "postgres": ["psycopg", "psycopg[binary]>=3.1.12", "psycopg[pool]>=3.2.0", "pgvector>=0.4.0"], |
| 34 | } |