Initialize the cosdata client
()
| 32 | |
| 33 | |
| 34 | def create_session(): |
| 35 | """Initialize the cosdata client""" |
| 36 | # Use environment variable from .env file if available, otherwise prompt |
| 37 | password = os.getenv("COSDATA_PASSWORD") |
| 38 | if not password: |
| 39 | password = getpass.getpass("Enter admin password: ") |
| 40 | |
| 41 | username = os.getenv("COSDATA_USERNAME", "admin") |
| 42 | |
| 43 | global client |
| 44 | client = Client(host=host, username=username, password=password, verify=False) |
| 45 | return client |
| 46 | |
| 47 | |
| 48 | def create_db(name, description=None, dimension=20000): |