Skip to content

Commit

Permalink
fix doc
Browse files Browse the repository at this point in the history
  • Loading branch information
ccurme committed Dec 17, 2024
1 parent a7a4544 commit 29044fc
Showing 1 changed file with 10 additions and 29 deletions.
39 changes: 10 additions & 29 deletions docs/docs/integrations/llm_caching.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,10 @@
},
{
"cell_type": "code",
"execution_count": 1,
"id": "88486f6f",
"metadata": {
"ExecuteTime": {
"end_time": "2024-12-06T00:53:54.575978Z",
"start_time": "2024-12-06T00:53:38.515785Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001B[33mWARNING: Ignoring invalid distribution ~angchain (/Users/aayushkataria/anaconda3/lib/python3.11/site-packages)\u001B[0m\u001B[33m\r\n",
"\u001B[0m\u001B[33mWARNING: Ignoring invalid distribution ~angchain (/Users/aayushkataria/anaconda3/lib/python3.11/site-packages)\u001B[0m\u001B[33m\r\n",
"\u001B[0m\u001B[33mWARNING: Ignoring invalid distribution ~angchain (/Users/aayushkataria/anaconda3/lib/python3.11/site-packages)\u001B[0m\u001B[33m\r\n",
"\u001B[0mNote: you may need to restart the kernel to use updated packages.\n"
]
}
],
"execution_count": null,
"id": "f938e881",
"metadata": {},
"outputs": [],
"source": [
"%pip install -qU langchain-openai langchain-community\n",
"\n",
Expand Down Expand Up @@ -1836,7 +1820,7 @@
},
{
"cell_type": "code",
"execution_count": 83,
"execution_count": null,
"id": "bc1570a2a77b58c8",
"metadata": {
"ExecuteTime": {
Expand Down Expand Up @@ -1866,7 +1850,7 @@
],
"source": [
"%%time\n",
"# The first time, it is not yet in cache, so it should take longer\n",
"# The second time it is, so it goes faster\n",
"llm.invoke(\"Tell me a joke\")"
]
},
Expand All @@ -1882,7 +1866,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": null,
"id": "41fea5aa7b2153ca",
"metadata": {
"ExecuteTime": {
Expand All @@ -1895,12 +1879,9 @@
"from typing import Any, Dict\n",
"\n",
"from azure.cosmos import CosmosClient, PartitionKey\n",
"\n",
"# from langchain_community.cache import AzureCosmosDBNoSqlSemanticCache\n",
"from langchain_community.cache import AzureCosmosDBNoSqlSemanticCache\n",
"from langchain_openai import OpenAIEmbeddings\n",
"\n",
"from libs.community.langchain_community.cache import AzureCosmosDBNoSqlSemanticCache\n",
"\n",
"HOST = \"COSMOS_DB_URI\"\n",
"KEY = \"COSMOS_DB_KEY\"\n",
"\n",
Expand Down Expand Up @@ -1982,7 +1963,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": null,
"id": "576ce24c1244812a",
"metadata": {
"ExecuteTime": {
Expand Down Expand Up @@ -2012,7 +1993,7 @@
],
"source": [
"%%time\n",
"# The first time, it is not yet in cache, so it should take longer\n",
"# The second time it is, so it goes faster\n",
"llm.invoke(\"Tell me a joke\")"
]
},
Expand Down

0 comments on commit 29044fc

Please sign in to comment.