Skip to content

Commit

Permalink
Fix notebook CI (#205)
Browse files Browse the repository at this point in the history
Because our notebooks are run in parallel using threads, for expedited
testing purposes, and using a single redis instance, there were
situations where different caches were created with the same name...
causing collisions.
  • Loading branch information
tylerhutcherson authored Aug 16, 2024
1 parent 685de7e commit 38f2fe1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/examples/openai_qna.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -861,7 +861,7 @@
"source": [
"from redisvl.extensions.llmcache import SemanticCache\n",
"\n",
"cache = SemanticCache(redis_url=\"redis://localhost:6379\", distance_threshold=0.2)"
"cache = SemanticCache(name=\"qna_cache\", redis_url=\"redis://localhost:6379\", distance_threshold=0.2)"
]
},
{
Expand Down
4 changes: 2 additions & 2 deletions docs/user_guide/llmcache_03.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@
"source": [
"llmcache.store(\"This is a TTL test\", \"This is a TTL test response\")\n",
"\n",
"time.sleep(5)"
"time.sleep(6)"
]
},
{
Expand Down Expand Up @@ -732,7 +732,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.2"
"version": "3.11.9"
},
"orig_nbformat": 4
},
Expand Down
2 changes: 1 addition & 1 deletion docs/user_guide/vectorizers_04.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@
"source": [
"from redisvl.extensions.llmcache import SemanticCache\n",
"\n",
"cache = SemanticCache(vectorizer=custom_vectorizer)\n",
"cache = SemanticCache(name=\"custom_cache\", vectorizer=custom_vectorizer)\n",
"\n",
"cache.store(\"this is a test prompt\", \"this is a test response\")\n",
"cache.check(\"this is also a test prompt\")"
Expand Down

0 comments on commit 38f2fe1

Please sign in to comment.