| from pymilvus import MilvusClient | |
| from pymilvus import ( | |
| connections, | |
| utility, | |
| FieldSchema, CollectionSchema, DataType, | |
| Collection, | |
| ) | |
| # 1. Create a milvus client | |
| client = MilvusClient( | |
| uri="http://localhost:19530", | |
| token="root:Milvus" | |
| ) | |
| # 2. Create a collection | |
| client.drop_collection(collection_name="fy2025_budget_statement") | |
| # 3. List collections | |
| print(client.list_collections() ) | |
| # ['test_collection'] | |
| """ | |
| res = client.get( | |
| collection_name="colpali", | |
| ids=[0, 1, 2], | |
| ) | |
| print(res) | |
| """ | |