Spaces:
Runtime error
Runtime error
File size: 479 Bytes
932db78 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
import os
from pymilvus import connections
def connect():
# Initialize a MilvusClient instance
# Replace uri and API key with your own
connections.connect(
alias=os.getenv('MILVUS_DEFAULT'),
uri=os.getenv("MILVUS_CLUSTER_ENDPOINT"), # Cluster endpoint obtained from the console
token=os.getenv("MILVUS_TOKEN") # API key or a colon-separated cluster username and password
)
def disconnect():
connections.disconnect("MILVUS_DEFAULT") |