Skip to content

Commit f5f7ddd

Browse files
committed
update pip install
1 parent 7d9d236 commit f5f7ddd

File tree

2 files changed

+40
-42
lines changed

2 files changed

+40
-42
lines changed

libs/redis/docs/cache.ipynb

Lines changed: 39 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -21,25 +21,23 @@
2121
{
2222
"metadata": {
2323
"ExecuteTime": {
24-
"end_time": "2025-11-22T07:10:04.327797Z",
25-
"start_time": "2025-11-22T07:10:01.111867Z"
24+
"end_time": "2025-11-22T17:06:36.495021Z",
25+
"start_time": "2025-11-22T17:06:35.814138Z"
2626
}
2727
},
2828
"cell_type": "code",
29-
"source": [
30-
"%pip install -qU langchain-core langchain-redis \"langchain-openai>=1.0.3\" \"redis<7.0\"\n",
31-
"%pip install -qU -e \"../[langcache]\""
32-
],
29+
"source": "%pip install -qU langchain-core \"langchain-redis[langcache]\" \"langchain-openai>=1.0.3\" \"redis<7.0\"",
3330
"outputs": [
3431
{
3532
"name": "stdout",
3633
"output_type": "stream",
3734
"text": [
35+
"\r\n",
3836
"Note: you may need to restart the kernel to use updated packages.\n"
3937
]
4038
}
4139
],
42-
"execution_count": 5
40+
"execution_count": 3
4341
},
4442
{
4543
"metadata": {},
@@ -57,8 +55,8 @@
5755
{
5856
"metadata": {
5957
"ExecuteTime": {
60-
"end_time": "2025-11-22T07:10:04.339135Z",
61-
"start_time": "2025-11-22T07:10:04.337286Z"
58+
"end_time": "2025-11-22T17:06:36.502005Z",
59+
"start_time": "2025-11-22T17:06:36.499949Z"
6260
}
6361
},
6462
"cell_type": "code",
@@ -79,7 +77,7 @@
7977
]
8078
}
8179
],
82-
"execution_count": 6
80+
"execution_count": 4
8381
},
8482
{
8583
"metadata": {},
@@ -89,8 +87,8 @@
8987
{
9088
"metadata": {
9189
"ExecuteTime": {
92-
"end_time": "2025-11-22T07:10:04.351558Z",
93-
"start_time": "2025-11-22T07:10:04.349814Z"
90+
"end_time": "2025-11-22T17:06:38.048298Z",
91+
"start_time": "2025-11-22T17:06:36.519903Z"
9492
}
9593
},
9694
"cell_type": "code",
@@ -105,7 +103,7 @@
105103
"from langchain_redis import RedisCache, RedisSemanticCache, LangCacheSemanticCache"
106104
],
107105
"outputs": [],
108-
"execution_count": 7
106+
"execution_count": 5
109107
},
110108
{
111109
"metadata": {},
@@ -115,8 +113,8 @@
115113
{
116114
"metadata": {
117115
"ExecuteTime": {
118-
"end_time": "2025-11-22T07:10:04.360419Z",
119-
"start_time": "2025-11-22T07:10:04.358547Z"
116+
"end_time": "2025-11-22T17:06:38.059329Z",
117+
"start_time": "2025-11-22T17:06:38.057687Z"
120118
}
121119
},
122120
"cell_type": "code",
@@ -143,7 +141,7 @@
143141
]
144142
}
145143
],
146-
"execution_count": 8
144+
"execution_count": 6
147145
},
148146
{
149147
"metadata": {},
@@ -153,8 +151,8 @@
153151
{
154152
"metadata": {
155153
"ExecuteTime": {
156-
"end_time": "2025-11-22T07:10:05.188067Z",
157-
"start_time": "2025-11-22T07:10:04.365151Z"
154+
"end_time": "2025-11-22T17:06:39.414088Z",
155+
"start_time": "2025-11-22T17:06:38.071005Z"
158156
}
159157
},
160158
"cell_type": "code",
@@ -201,20 +199,20 @@
201199
"Result: \n",
202200
"\n",
203201
"Caching is the process of storing frequently accessed data in a temporary storage location for faster retrieval. This helps to reduce the time and resources needed to access the data from its original source. Caching is commonly used in computer systems, web browsers, and databases to improve performance and efficiency.\n",
204-
"Time: 0.68 seconds\n",
202+
"Time: 1.15 seconds\n",
205203
"\n",
206204
"Second call (cached):\n",
207205
"Result: \n",
208206
"\n",
209207
"Caching is the process of storing frequently accessed data in a temporary storage location for faster retrieval. This helps to reduce the time and resources needed to access the data from its original source. Caching is commonly used in computer systems, web browsers, and databases to improve performance and efficiency.\n",
210208
"Time: 0.00 seconds\n",
211209
"\n",
212-
"Speed improvement: 525.11x faster\n",
210+
"Speed improvement: 552.26x faster\n",
213211
"Cache cleared\n"
214212
]
215213
}
216214
],
217-
"execution_count": 9
215+
"execution_count": 7
218216
},
219217
{
220218
"metadata": {},
@@ -224,8 +222,8 @@
224222
{
225223
"metadata": {
226224
"ExecuteTime": {
227-
"end_time": "2025-11-22T07:10:07.296869Z",
228-
"start_time": "2025-11-22T07:10:05.206110Z"
225+
"end_time": "2025-11-22T17:06:43.518554Z",
226+
"start_time": "2025-11-22T17:06:39.428393Z"
229227
}
230228
},
231229
"cell_type": "code",
@@ -277,22 +275,22 @@
277275
"Result: \n",
278276
"\n",
279277
"The capital of France is Paris.\n",
280-
"Time: 1.37 seconds\n",
278+
"Time: 3.05 seconds\n",
281279
"\n",
282280
"Similar query:\n",
283281
"Prompt: Can you tell me the capital city of France?\n",
284282
"\n",
285283
"Result: \n",
286284
"\n",
287285
"The capital of France is Paris.\n",
288-
"Time: 0.39 seconds\n",
286+
"Time: 0.14 seconds\n",
289287
"\n",
290-
"Speed improvement: 3.48x faster\n",
288+
"Speed improvement: 21.12x faster\n",
291289
"Semantic cache cleared\n"
292290
]
293291
}
294292
],
295-
"execution_count": 10
293+
"execution_count": 8
296294
},
297295
{
298296
"metadata": {},
@@ -311,8 +309,8 @@
311309
{
312310
"metadata": {
313311
"ExecuteTime": {
314-
"end_time": "2025-11-22T07:10:09.664948Z",
315-
"start_time": "2025-11-22T07:10:07.313993Z"
312+
"end_time": "2025-11-22T17:06:44.679848Z",
313+
"start_time": "2025-11-22T17:06:43.540988Z"
316314
}
317315
},
318316
"cell_type": "code",
@@ -390,28 +388,28 @@
390388
"Result: \n",
391389
"\n",
392390
"The capital of France is Paris.\n",
393-
"Time: 2.02 seconds\n",
391+
"Time: 0.85 seconds\n",
394392
"\n",
395393
"Similar query:\n",
396394
"Prompt: Can you tell me the capital city of France?\n",
397395
"\n",
398396
"Result: \n",
399397
"\n",
400398
"The capital of France is Paris.\n",
401-
"Time: 0.15 seconds\n",
399+
"Time: 0.13 seconds\n",
402400
"\n",
403-
"(Similar query) Speed improvement: 13.78x faster\n",
401+
"(Similar query) Speed improvement: 6.75x faster\n",
404402
"Semantic cache cleared\n"
405403
]
406404
}
407405
],
408-
"execution_count": 11
406+
"execution_count": 9
409407
},
410408
{
411409
"metadata": {
412410
"ExecuteTime": {
413-
"end_time": "2025-11-22T07:10:09.686945Z",
414-
"start_time": "2025-11-22T07:10:09.685687Z"
411+
"end_time": "2025-11-22T17:06:44.697353Z",
412+
"start_time": "2025-11-22T17:06:44.696216Z"
415413
}
416414
},
417415
"cell_type": "code",
@@ -432,8 +430,8 @@
432430
{
433431
"metadata": {
434432
"ExecuteTime": {
435-
"end_time": "2025-11-22T07:10:15.708721Z",
436-
"start_time": "2025-11-22T07:10:09.689547Z"
433+
"end_time": "2025-11-22T17:06:50.714859Z",
434+
"start_time": "2025-11-22T17:06:44.700932Z"
437435
}
438436
},
439437
"cell_type": "code",
@@ -470,7 +468,7 @@
470468
]
471469
}
472470
],
473-
"execution_count": 12
471+
"execution_count": 10
474472
},
475473
{
476474
"metadata": {},
@@ -480,8 +478,8 @@
480478
{
481479
"metadata": {
482480
"ExecuteTime": {
483-
"end_time": "2025-11-22T07:10:17.430674Z",
484-
"start_time": "2025-11-22T07:10:15.729854Z"
481+
"end_time": "2025-11-22T17:06:52.510744Z",
482+
"start_time": "2025-11-22T17:06:50.738791Z"
485483
}
486484
},
487485
"cell_type": "code",
@@ -524,7 +522,7 @@
524522
]
525523
}
526524
],
527-
"execution_count": 13
525+
"execution_count": 11
528526
},
529527
{
530528
"metadata": {},

libs/redis/langchain_redis/cache.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -732,7 +732,7 @@ class LangCacheSemanticCache(BaseCache):
732732
over the managed LangCache API). The optional dependency ``langcache`` must
733733
be installed at runtime when this class is used. Install with either
734734
``pip install 'langchain-redis[langcache]'`` or
735-
``pip install 'langcache>=0.10.0'``.
735+
``pip install langcache``.
736736
737737
Args:
738738
distance_threshold (float): Maximum distance for semantic matches.

0 commit comments

Comments
 (0)