Skip to content

Commit fc4dd2d

Browse files
author
huaixin.yjy
committed
improve
1 parent 4b9ca99 commit fc4dd2d

File tree

1 file changed

+7
-16
lines changed

1 file changed

+7
-16
lines changed

notebooks/alibabacloud-ai-search/inference-alibabacloud-ai-search.ipynb

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"\n",
1717
"For this example, you will need:\n",
1818
"\n",
19-
"- An Elastic deployment with minimum **4GB machine learning node**\n",
19+
"- An Elastic deployment:\n",
2020
" - we'll be using [Alibaba Elasticsearch](https://www.aliyun.com/product/bigdata/elasticsearch) for this example.\n",
2121
"- Elasticsearch 8.16 or above\n",
2222
"- A valid API key for the [AlibabaCloud AI Search](https://help.aliyun.com/zh/open-search/search-platform/user-guide/activate-services-and-create-api-key?spm=a2c4g.11186623.0.0.141a2105fiqCEw) is required to use the Inference API with\n",
@@ -56,7 +56,7 @@
5656
},
5757
{
5858
"cell_type": "code",
59-
"execution_count": 2,
59+
"execution_count": 6,
6060
"metadata": {},
6161
"outputs": [],
6262
"source": [
@@ -87,16 +87,15 @@
8787
"\n",
8888
"ELASTIC_PASSWORD = getpass(\"ELASTIC PASSWORD: \")\n",
8989
"\n",
90-
"# Please enter your ES cluster URL here\n",
9190
"# e.g. \n",
92-
"# ELASTIC_URL = \"http://es-xxx.elasticsearch.aliyuncs.com:9200\"\n",
93-
"ELASTIC_URL = \"\"\n",
91+
"# hosts = \"http://es-xxx.elasticsearch.aliyuncs.com:9200\"\n",
92+
"hosts=getpass(\"Host: \")\n",
9493
"\n",
9594
"# Create the client instance\n",
9695
"client = Elasticsearch(\n",
9796
" # For local development\n",
9897
" # hosts=[\"http://localhost:9200\"]\n",
99-
" ELASTIC_URL,\n",
98+
" hosts,\n",
10099
" basic_auth=(ELASTIC_USER, ELASTIC_PASSWORD)\n",
101100
")"
102101
]
@@ -110,17 +109,9 @@
110109
},
111110
{
112111
"cell_type": "code",
113-
"execution_count": 8,
112+
"execution_count": null,
114113
"metadata": {},
115-
"outputs": [
116-
{
117-
"name": "stdout",
118-
"output_type": "stream",
119-
"text": [
120-
"{'name': 'es-cn-kvw3sriro00013ijf-data-g-2', 'cluster_name': 'es-cn-kvw3sriro00013ijf', 'cluster_uuid': 'Zh1hPR59Qf2wQpMCnzuoyQ', 'version': {'number': '8.15.0', 'build_flavor': 'default', 'build_type': 'docker', 'build_hash': '27668b65831e9e4eff409e9a3021d601e22b3f74', 'build_date': '2024-07-24T07:11:07.450209633Z', 'build_snapshot': False, 'lucene_version': '9.11.1', 'minimum_wire_compatibility_version': '7.17.0', 'minimum_index_compatibility_version': '7.0.0'}, 'tagline': 'You Know, for Search'}\n"
121-
]
122-
}
123-
],
114+
"outputs": [],
124115
"source": [
125116
"print(client.info())"
126117
]

0 commit comments

Comments
 (0)