File size: 612 Bytes
728520f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import os
from dotenv import load_dotenv
load_dotenv('.env')

from pymilvus import connections, utility

# Connect to Milvus
connections.connect(
    uri=os.getenv('ZILLIZ_URI'),
    token=os.getenv('ZILLIZ_TOKEN')
)

collection_name = os.getenv('ZILLIZ_COLLECTION', 'visaverse_faqs3')

# Drop the old collection to start fresh
if utility.has_collection(collection_name):
    utility.drop_collection(collection_name)
    print(f"✅ Dropped old collection '{collection_name}'")
    print("🔄 Restart the chatbot to reload with fresh IRCC data")
else:
    print(f"Collection '{collection_name}' doesn't exist")