import sys import os sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '../../'))) from main import app from utils.db.db import mongo def create_chat_session_collection(): with app.app_context(): try: mongo.db.create_collection("chatsession") print("Collection 'chatsession' created successfully.") except Exception as e: print(f"An error occurred: {e}") if __name__ == "__main__": create_chat_session_collection()