Skip to content

Commit 79e9f32

Browse files
committed
clearing output
Cleared outputs
1 parent 47b6c14 commit 79e9f32

File tree

1 file changed

+17
-159
lines changed

1 file changed

+17
-159
lines changed

supporting-blog-content/unifying-elastic-vector-database-and-llms-for-intelligent-query/Unifying_Elastic_Vector_Database_and_LLMs_for_Intelligent_Query.ipynb

Lines changed: 17 additions & 159 deletions
Original file line numberDiff line numberDiff line change
@@ -22,68 +22,22 @@
2222
},
2323
{
2424
"cell_type": "code",
25-
"execution_count": 3,
25+
"execution_count": null,
2626
"metadata": {
2727
"colab": {
2828
"base_uri": "https://localhost:8080/"
2929
},
3030
"id": "kply8eYngIAL",
3131
"outputId": "d303bfa2-ce7e-4211-d425-1f618141a293"
3232
},
33-
"outputs": [
34-
{
35-
"name": "stdout",
36-
"output_type": "stream",
37-
"text": [
38-
"Requirement already satisfied: elasticsearch in /Users/sunilemanjee/Documents/GitHub/elasticsearch-labs/.venv/lib/python3.12/site-packages (8.17.1)\n",
39-
"Collecting openai\n",
40-
" Downloading openai-1.63.2-py3-none-any.whl.metadata (27 kB)\n",
41-
"Requirement already satisfied: elastic-transport<9,>=8.15.1 in /Users/sunilemanjee/Documents/GitHub/elasticsearch-labs/.venv/lib/python3.12/site-packages (from elasticsearch) (8.17.0)\n",
42-
"Requirement already satisfied: anyio<5,>=3.5.0 in /Users/sunilemanjee/Documents/GitHub/elasticsearch-labs/.venv/lib/python3.12/site-packages (from openai) (4.6.2.post1)\n",
43-
"Collecting distro<2,>=1.7.0 (from openai)\n",
44-
" Using cached distro-1.9.0-py3-none-any.whl.metadata (6.8 kB)\n",
45-
"Requirement already satisfied: httpx<1,>=0.23.0 in /Users/sunilemanjee/Documents/GitHub/elasticsearch-labs/.venv/lib/python3.12/site-packages (from openai) (0.27.2)\n",
46-
"Collecting jiter<1,>=0.4.0 (from openai)\n",
47-
" Downloading jiter-0.8.2-cp312-cp312-macosx_11_0_arm64.whl.metadata (5.2 kB)\n",
48-
"Collecting pydantic<3,>=1.9.0 (from openai)\n",
49-
" Downloading pydantic-2.10.6-py3-none-any.whl.metadata (30 kB)\n",
50-
"Requirement already satisfied: sniffio in /Users/sunilemanjee/Documents/GitHub/elasticsearch-labs/.venv/lib/python3.12/site-packages (from openai) (1.3.1)\n",
51-
"Requirement already satisfied: tqdm>4 in /Users/sunilemanjee/Documents/GitHub/elasticsearch-labs/.venv/lib/python3.12/site-packages (from openai) (4.66.5)\n",
52-
"Requirement already satisfied: typing-extensions<5,>=4.11 in /Users/sunilemanjee/Documents/GitHub/elasticsearch-labs/.venv/lib/python3.12/site-packages (from openai) (4.12.2)\n",
53-
"Requirement already satisfied: idna>=2.8 in /Users/sunilemanjee/Documents/GitHub/elasticsearch-labs/.venv/lib/python3.12/site-packages (from anyio<5,>=3.5.0->openai) (3.10)\n",
54-
"Requirement already satisfied: urllib3<3,>=1.26.2 in /Users/sunilemanjee/Documents/GitHub/elasticsearch-labs/.venv/lib/python3.12/site-packages (from elastic-transport<9,>=8.15.1->elasticsearch) (2.2.3)\n",
55-
"Requirement already satisfied: certifi in /Users/sunilemanjee/Documents/GitHub/elasticsearch-labs/.venv/lib/python3.12/site-packages (from elastic-transport<9,>=8.15.1->elasticsearch) (2024.8.30)\n",
56-
"Requirement already satisfied: httpcore==1.* in /Users/sunilemanjee/Documents/GitHub/elasticsearch-labs/.venv/lib/python3.12/site-packages (from httpx<1,>=0.23.0->openai) (1.0.6)\n",
57-
"Requirement already satisfied: h11<0.15,>=0.13 in /Users/sunilemanjee/Documents/GitHub/elasticsearch-labs/.venv/lib/python3.12/site-packages (from httpcore==1.*->httpx<1,>=0.23.0->openai) (0.14.0)\n",
58-
"Collecting annotated-types>=0.6.0 (from pydantic<3,>=1.9.0->openai)\n",
59-
" Using cached annotated_types-0.7.0-py3-none-any.whl.metadata (15 kB)\n",
60-
"Collecting pydantic-core==2.27.2 (from pydantic<3,>=1.9.0->openai)\n",
61-
" Downloading pydantic_core-2.27.2-cp312-cp312-macosx_11_0_arm64.whl.metadata (6.6 kB)\n",
62-
"Downloading openai-1.63.2-py3-none-any.whl (472 kB)\n",
63-
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m472.3/472.3 kB\u001b[0m \u001b[31m11.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m\n",
64-
"\u001b[?25hUsing cached distro-1.9.0-py3-none-any.whl (20 kB)\n",
65-
"Downloading jiter-0.8.2-cp312-cp312-macosx_11_0_arm64.whl (310 kB)\n",
66-
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m310.3/310.3 kB\u001b[0m \u001b[31m25.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
67-
"\u001b[?25hDownloading pydantic-2.10.6-py3-none-any.whl (431 kB)\n",
68-
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m431.7/431.7 kB\u001b[0m \u001b[31m29.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
69-
"\u001b[?25hDownloading pydantic_core-2.27.2-cp312-cp312-macosx_11_0_arm64.whl (1.8 MB)\n",
70-
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m1.8/1.8 MB\u001b[0m \u001b[31m33.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n",
71-
"\u001b[?25hUsing cached annotated_types-0.7.0-py3-none-any.whl (13 kB)\n",
72-
"Installing collected packages: pydantic-core, jiter, distro, annotated-types, pydantic, openai\n",
73-
"Successfully installed annotated-types-0.7.0 distro-1.9.0 jiter-0.8.2 openai-1.63.2 pydantic-2.10.6 pydantic-core-2.27.2\n",
74-
"\n",
75-
"\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m A new release of pip is available: \u001b[0m\u001b[31;49m24.0\u001b[0m\u001b[39;49m -> \u001b[0m\u001b[32;49m25.0.1\u001b[0m\n",
76-
"\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m To update, run: \u001b[0m\u001b[32;49mpip install --upgrade pip\u001b[0m\n"
77-
]
78-
}
79-
],
33+
"outputs": [],
8034
"source": [
8135
"!pip install elasticsearch openai"
8236
]
8337
},
8438
{
8539
"cell_type": "code",
86-
"execution_count": 5,
40+
"execution_count": null,
8741
"metadata": {
8842
"id": "wcPv-D6lwHsk"
8943
},
@@ -121,34 +75,15 @@
12175
},
12276
{
12377
"cell_type": "code",
124-
"execution_count": 29,
78+
"execution_count": null,
12579
"metadata": {
12680
"colab": {
12781
"base_uri": "https://localhost:8080/"
12882
},
12983
"id": "U7bQisDzgThO",
13084
"outputId": "8271b49f-7860-4429-9606-4914eeb7e935"
13185
},
132-
"outputs": [
133-
{
134-
"name": "stderr",
135-
"output_type": "stream",
136-
"text": [
137-
"<ipython-input-29-39a59176fe0b>:1: DeprecationWarning: The 'timeout' parameter is deprecated in favor of 'request_timeout'\n",
138-
" es = Elasticsearch(\n"
139-
]
140-
},
141-
{
142-
"data": {
143-
"text/plain": [
144-
"ObjectApiResponse({'name': 'instance-0000000001', 'cluster_name': 'c2ab8f2bea544fa98be6ab7deaa857f7', 'cluster_uuid': 'ymWuH36TQy-03wb-MIx27w', 'version': {'number': '8.17.2', 'build_flavor': 'default', 'build_type': 'docker', 'build_hash': '747663ddda3421467150de0e4301e8d4bc636b0c', 'build_date': '2025-02-05T22:10:57.067596412Z', 'build_snapshot': False, 'lucene_version': '9.12.0', 'minimum_wire_compatibility_version': '7.17.0', 'minimum_index_compatibility_version': '7.0.0'}, 'tagline': 'You Know, for Search'})"
145-
]
146-
},
147-
"execution_count": 29,
148-
"metadata": {},
149-
"output_type": "execute_result"
150-
}
151-
],
86+
"outputs": [],
15287
"source": [
15388
"es_cloud_id = getpass(prompt=\"Enter your Elasticsearch Cloud ID: \")\n",
15489
"es_api_key = getpass(prompt=\"Enter your Elasticsearch API key: \")\n",
@@ -169,7 +104,7 @@
169104
},
170105
{
171106
"cell_type": "code",
172-
"execution_count": 31,
107+
"execution_count": null,
173108
"metadata": {
174109
"id": "wbwpo08qzn4f"
175110
},
@@ -217,7 +152,7 @@
217152
},
218153
{
219154
"cell_type": "code",
220-
"execution_count": 32,
155+
"execution_count": null,
221156
"metadata": {
222157
"id": "dgpGnZQbb7U_"
223158
},
@@ -230,7 +165,7 @@
230165
},
231166
{
232167
"cell_type": "code",
233-
"execution_count": 33,
168+
"execution_count": null,
234169
"metadata": {
235170
"id": "fiVFDWOYUgvH"
236171
},
@@ -298,7 +233,7 @@
298233
},
299234
{
300235
"cell_type": "code",
301-
"execution_count": 34,
236+
"execution_count": null,
302237
"metadata": {
303238
"id": "RMZoAAq5y0YA"
304239
},
@@ -370,7 +305,7 @@
370305
},
371306
{
372307
"cell_type": "code",
373-
"execution_count": 35,
308+
"execution_count": null,
374309
"metadata": {
375310
"id": "H3xh9gbezHfO"
376311
},
@@ -570,7 +505,7 @@
570505
},
571506
{
572507
"cell_type": "code",
573-
"execution_count": 36,
508+
"execution_count": null,
574509
"metadata": {
575510
"id": "L6E7DFWcTEnb"
576511
},
@@ -811,7 +746,7 @@
811746
},
812747
{
813748
"cell_type": "code",
814-
"execution_count": 37,
749+
"execution_count": null,
815750
"metadata": {
816751
"id": "S28E_3t5PEib"
817752
},
@@ -864,7 +799,7 @@
864799
},
865800
{
866801
"cell_type": "code",
867-
"execution_count": 38,
802+
"execution_count": null,
868803
"metadata": {
869804
"id": "tVWlVx0cNWUd"
870805
},
@@ -944,7 +879,7 @@
944879
},
945880
{
946881
"cell_type": "code",
947-
"execution_count": 39,
882+
"execution_count": null,
948883
"metadata": {
949884
"id": "t2E7YSk-LH_J"
950885
},
@@ -973,7 +908,7 @@
973908
},
974909
{
975910
"cell_type": "code",
976-
"execution_count": 40,
911+
"execution_count": null,
977912
"metadata": {
978913
"id": "1EXrB0KdLKH1"
979914
},
@@ -1031,92 +966,15 @@
1031966
},
1032967
{
1033968
"cell_type": "code",
1034-
"execution_count": 41,
969+
"execution_count": null,
1035970
"metadata": {
1036971
"colab": {
1037972
"base_uri": "https://localhost:8080/"
1038973
},
1039974
"id": "OyZKPEPEl4v5",
1040975
"outputId": "2021e133-6828-4c28-d6a9-bc233092efa2"
1041976
},
1042-
"outputs": [
1043-
{
1044-
"name": "stdout",
1045-
"output_type": "stream",
1046-
"text": [
1047-
"\n",
1048-
"Formatted Messages:\n",
1049-
"Message 1:\n",
1050-
"Role: assistant\n",
1051-
"Tool Calls:\n",
1052-
" Tool Call ID: call_MzuWSxe6HtXp3RhfHEmJ6Z85\n",
1053-
" Function Name: extract_hotel_search_parameters\n",
1054-
" Arguments: {\"query\":\"recently renovated accommodations 250m from Belongil Beach with at least 4 stars and with a pool and gym\",\"distance\":\"250m\",\"rating\":4,\"location\":\"Belongil Beach\",\"attraction\":\"recently renovated,pool,gym\"}\n",
1055-
"\n",
1056-
"--------------------------------------------------\n",
1057-
"Function Arguments for extract_hotel_search_parameters:\n",
1058-
"{'query': 'recently renovated accommodations 250m from Belongil Beach with at least 4 stars and with a pool and gym', 'distance': '250m', 'rating': 4, 'location': 'Belongil Beach', 'attraction': 'recently renovated,pool,gym'}\n",
1059-
"Response from handle_extract_hotel_search_parameters:\n",
1060-
"{\"query\": \"recently renovated accommodations 250m from Belongil Beach with at least 4 stars and with a pool and gym\", \"distance\": \"250m\", \"rating\": 4, \"location\": \"Belongil Beach\", \"attraction\": \"recently renovated,pool,gym\"}\n",
1061-
"Updated parameters after extract_hotel_search_parameters:\n",
1062-
"{'query': 'recently renovated accommodations 250m from Belongil Beach with at least 4 stars and with a pool and gym', 'distance': '250m', 'rating': 4, 'location': 'Belongil Beach', 'attraction': 'recently renovated,pool,gym'}\n",
1063-
"\n",
1064-
"Formatted Messages:\n",
1065-
"Message 1:\n",
1066-
"Role: assistant\n",
1067-
"Tool Calls:\n",
1068-
" Tool Call ID: call_STsRLGP8GcBhgWzRuJYnKw0k\n",
1069-
" Function Name: geocode_location\n",
1070-
" Arguments: {\"location\":\"Belongil Beach\"}\n",
1071-
"\n",
1072-
"--------------------------------------------------\n",
1073-
"Updated parameters after geocode_location:\n",
1074-
"{'query': 'recently renovated accommodations 250m from Belongil Beach with at least 4 stars and with a pool and gym', 'distance': '250m', 'rating': 4, 'location': 'Belongil Beach', 'attraction': 'recently renovated,pool,gym', 'latitude': -28.6337328, 'longitude': 153.6003455}\n",
1075-
"\n",
1076-
"Formatted Messages:\n",
1077-
"Message 1:\n",
1078-
"Role: assistant\n",
1079-
"Tool Calls:\n",
1080-
" Tool Call ID: call_m2XTVPxzXT0mmu0QueYO5YLI\n",
1081-
" Function Name: query_elasticsearch\n",
1082-
" Arguments: {\"query\":\"recently renovated accommodations 250m from Belongil Beach with at least 4 stars and with a pool and gym\",\"latitude\":-28.6337328,\"longitude\":153.6003455,\"distance\":\"250m\",\"rating\":4,\"attraction\":\"recently renovated,pool,gym\"}\n",
1083-
"\n",
1084-
"--------------------------------------------------\n",
1085-
"Function Arguments for extract_hotel_search_parameters:\n",
1086-
"{'query': 'recently renovated accommodations 250m from Belongil Beach with at least 4 stars and with a pool and gym', 'latitude': -28.6337328, 'longitude': 153.6003455, 'distance': '250m', 'rating': 4, 'attraction': 'recently renovated,pool,gym'}\n",
1087-
"Parameters for Elasticsearch:\n",
1088-
"{'query': 'recently renovated accommodations 250m from Belongil Beach with at least 4 stars and with a pool and gym', 'latitude': -28.6337328, 'longitude': 153.6003455, 'distance': '250m', 'rating': 4, 'attraction': 'recently renovated,pool,gym'}\n",
1089-
"Elasticsearch Query:\n",
1090-
"{\n",
1091-
" \"id\": \"hotel_search_template\",\n",
1092-
" \"params\": {\n",
1093-
" \"query\": \"recently renovated accommodations 250m from Belongil Beach with at least 4 stars and with a pool and gym\",\n",
1094-
" \"latitude\": -28.6337328,\n",
1095-
" \"longitude\": 153.6003455,\n",
1096-
" \"distance\": \"250m\",\n",
1097-
" \"rating\": 4,\n",
1098-
" \"attraction\": \"recently renovated,pool,gym\"\n",
1099-
" }\n",
1100-
"}\n",
1101-
"Elasticsearch query successful.\n",
1102-
"Number of results found: 1\n",
1103-
"\n",
1104-
"Formatted Messages:\n",
1105-
"Message 1:\n",
1106-
"Role: assistant\n",
1107-
"Content: I found the following recently renovated accommodation 250m from Belongil Beach with at least 4 stars, a pool, and a gym:\n",
1108-
"\n",
1109-
"- **Hotel Name:** Belongil Beach Apartment\n",
1110-
"- **Rating:** 4 stars\n",
1111-
"- **City:** Byron Bay, New South Wales\n",
1112-
"- **Country:** Australia\n",
1113-
"\n",
1114-
"Would you like more details or assistance with anything else?\n",
1115-
"\n",
1116-
"--------------------------------------------------\n"
1117-
]
1118-
}
1119-
],
977+
"outputs": [],
1120978
"source": [
1121979
"find_a_hotel(\n",
1122980
" \"recently renovated accommodations 250m from Belongil Beach with at least 4 stars and with a pool and gym\"\n",

0 commit comments

Comments
 (0)