Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add instructions how to add api token to connect zilliz #1200

Merged
merged 1 commit into from
Nov 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added images/zilliz_cluster_uri_token.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 43 additions & 1 deletion notebooks/milvus_connect.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,49 @@
"- Per free tier cluster, up to two collections (or vectordb indexes, you can think of these like \"tables\" of vectors) at a time.\n",
"- Each free tier collection can support up to 1M vectors.\n",
"\n",
"If you require additional clusters, we recommend subscribing to either our Standard or Enterprise plan."
"If you require additional clusters, we recommend subscribing to either our Standard or Enterprise plan.\n",
"\n",
"## 👩 Set up instructions for Zilliz \n",
"\n",
"1. From [cloud.zilliz.com](cloud.zilliz.com), click **\"+ Create Cluster\"**\n",
"2. Select <i>**Starter**</i> option for the cluster and click **\"Next: Create Collection\"**\n",
"3. Name your collection with a <i>**Collection Name**</i> and click **\"Create Collection and Cluster\"**.\n",
"4. From the Clusters page, \n",
" - copy the cluster uri and save somewhere locally.\n",
" - copy your cluster API KEY. Keep this private!\n",
"<div>\n",
"<img src=\"../images/zilliz_cluster_uri_token.png\" width=\"80%\"/>\n",
"</div>\n",
"\n",
"5. Add the API KEY to your environment variables. See this [article for instructions](https://help.openai.com/en/articles/5112595-best-practices-for-api-key-safety) how in either Windows or Mac/Linux environment.\n",
"6. In Jupyter, need .env file (in same dir as notebooks) containing lines like this:\n",
" - VARIABLE_NAME=value\n",
"7. In your code, connect to your Zilliz cluster, see code example below."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import os\n",
"from dotenv import load_dotenv\n",
"load_dotenv()\n",
"TOKEN = os.getenv(\"ZILLIZ_API_KEY\")\n",
"\n",
"# Connect to Zilliz cloud using enpoint URI and API key TOKEN.\n",
"CLUSTER_ENDPOINT=\"https://in03-xxxx.api.gcp-us-west1.zillizcloud.com:443\"\n",
"connections.connect(\n",
" alias='default',\n",
" # Public endpoint obtained from Zilliz Cloud\n",
" uri=CLUSTER_ENDPOINT,\n",
" # API key or a colon-separated cluster username and password\n",
" token=TOKEN,\n",
")\n",
"\n",
"# Check if the server is ready and get colleciton name.\n",
"print(f\"Type of server: {utility.get_server_version()}\")"
]
}
],
Expand Down