diff --git a/.python-version b/.python-version deleted file mode 100644 index b6d8b761..00000000 --- a/.python-version +++ /dev/null @@ -1 +0,0 @@ -3.11.8 diff --git a/python-recipes/semantic-cache/02_semantic_cache_optimization.ipynb b/python-recipes/semantic-cache/02_semantic_cache_optimization.ipynb index 3a3054a8..f7933d63 100644 --- a/python-recipes/semantic-cache/02_semantic_cache_optimization.ipynb +++ b/python-recipes/semantic-cache/02_semantic_cache_optimization.ipynb @@ -26,8 +26,7 @@ "metadata": {}, "outputs": [], "source": [ - "# install from branch since scheduled for 0.5.0\n", - "%pip install git+https://github.com/redis/redis-vl-python.git@0.5.0" + "%pip install \"redisvl>=0.6.0\"" ] }, { diff --git a/python-recipes/semantic-router/00_semantic_routing.ipynb b/python-recipes/semantic-router/00_semantic_routing.ipynb index cdf57fbc..5b1e0329 100644 --- a/python-recipes/semantic-router/00_semantic_routing.ipynb +++ b/python-recipes/semantic-router/00_semantic_routing.ipynb @@ -29,7 +29,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 26, "id": "c620286e", "metadata": {}, "outputs": [ @@ -37,12 +37,15 @@ "name": "stdout", "output_type": "stream", "text": [ + "\n", + "\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.1\u001b[0m\n", + "\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", "Note: you may need to restart the kernel to use updated packages.\n" ] } ], "source": [ - "%pip install -q \"redisvl>=0.4.1\" sentence-transformers" + "%pip install -q \"redisvl>=0.6.0\" sentence-transformers" ] }, { diff --git a/python-recipes/semantic-router/01_routing_optimization.ipynb b/python-recipes/semantic-router/01_routing_optimization.ipynb index db770c70..2c366ba1 100644 --- a/python-recipes/semantic-router/01_routing_optimization.ipynb +++ b/python-recipes/semantic-router/01_routing_optimization.ipynb @@ -44,58 +44,7 @@ } ], "source": [ - "%pip install -q sentence-transformers ranx" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "717284f0", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Collecting git+https://github.com/redis/redis-vl-python.git@0.5.0\n", - " Cloning https://github.com/redis/redis-vl-python.git (to revision 0.5.0) to /private/var/folders/_g/rr4lnxxx1_z7m78lz89dhvsm0000gp/T/pip-req-build-54zjmrpr\n", - " Running command git clone --filter=blob:none --quiet https://github.com/redis/redis-vl-python.git /private/var/folders/_g/rr4lnxxx1_z7m78lz89dhvsm0000gp/T/pip-req-build-54zjmrpr\n", - " Running command git checkout -b 0.5.0 --track origin/0.5.0\n", - " Switched to a new branch '0.5.0'\n", - " branch '0.5.0' set up to track 'origin/0.5.0'.\n", - " Resolved https://github.com/redis/redis-vl-python.git to commit 3ca4c97baa9640d24feedd3bb3791cf95859367d\n", - " Installing build dependencies ... \u001b[?25ldone\n", - "\u001b[?25h Getting requirements to build wheel ... \u001b[?25ldone\n", - "\u001b[?25h Preparing metadata (pyproject.toml) ... \u001b[?25ldone\n", - "\u001b[?25hRequirement already satisfied: coloredlogs<16.0,>=15.0 in /Users/robert.shelton/.pyenv/versions/3.11.8/lib/python3.11/site-packages (from redisvl==0.4.1) (15.0.1)\n", - "Requirement already satisfied: ml-dtypes<0.5.0,>=0.4.0 in /Users/robert.shelton/.pyenv/versions/3.11.8/lib/python3.11/site-packages (from redisvl==0.4.1) (0.4.1)\n", - "Requirement already satisfied: numpy<2,>=1 in /Users/robert.shelton/.pyenv/versions/3.11.8/lib/python3.11/site-packages (from redisvl==0.4.1) (1.26.4)\n", - "Requirement already satisfied: pydantic<3,>=2 in /Users/robert.shelton/.pyenv/versions/3.11.8/lib/python3.11/site-packages (from redisvl==0.4.1) (2.7.4)\n", - "Requirement already satisfied: python-ulid<4.0.0,>=3.0.0 in /Users/robert.shelton/.pyenv/versions/3.11.8/lib/python3.11/site-packages (from redisvl==0.4.1) (3.0.0)\n", - "Requirement already satisfied: pyyaml<7.0,>=5.4 in /Users/robert.shelton/.pyenv/versions/3.11.8/lib/python3.11/site-packages (from redisvl==0.4.1) (6.0.1)\n", - "Requirement already satisfied: redis<6.0,>=5.0 in /Users/robert.shelton/.pyenv/versions/3.11.8/lib/python3.11/site-packages (from redisvl==0.4.1) (5.0.5)\n", - "Requirement already satisfied: tabulate<0.10.0,>=0.9.0 in /Users/robert.shelton/.pyenv/versions/3.11.8/lib/python3.11/site-packages (from redisvl==0.4.1) (0.9.0)\n", - "Requirement already satisfied: tenacity>=8.2.2 in /Users/robert.shelton/.pyenv/versions/3.11.8/lib/python3.11/site-packages (from redisvl==0.4.1) (8.3.0)\n", - "Requirement already satisfied: humanfriendly>=9.1 in /Users/robert.shelton/.pyenv/versions/3.11.8/lib/python3.11/site-packages (from coloredlogs<16.0,>=15.0->redisvl==0.4.1) (10.0)\n", - "Requirement already satisfied: annotated-types>=0.4.0 in /Users/robert.shelton/.pyenv/versions/3.11.8/lib/python3.11/site-packages (from pydantic<3,>=2->redisvl==0.4.1) (0.7.0)\n", - "Requirement already satisfied: pydantic-core==2.18.4 in /Users/robert.shelton/.pyenv/versions/3.11.8/lib/python3.11/site-packages (from pydantic<3,>=2->redisvl==0.4.1) (2.18.4)\n", - "Requirement already satisfied: typing-extensions>=4.6.1 in /Users/robert.shelton/.pyenv/versions/3.11.8/lib/python3.11/site-packages (from pydantic<3,>=2->redisvl==0.4.1) (4.12.2)\n", - "Building wheels for collected packages: redisvl\n", - " Building wheel for redisvl (pyproject.toml) ... \u001b[?25ldone\n", - "\u001b[?25h Created wheel for redisvl: filename=redisvl-0.4.1-py3-none-any.whl size=113401 sha256=973e3b34a10bf10547873947798f4c37f681a87bd1f53c7cf938f2b4bccd71a6\n", - " Stored in directory: /private/var/folders/_g/rr4lnxxx1_z7m78lz89dhvsm0000gp/T/pip-ephem-wheel-cache-wt36bttp/wheels/95/dc/1e/d8dc251e38989044675dae0b596a2dee10cbfdecac5c62ccdf\n", - "Successfully built redisvl\n", - "Installing collected packages: redisvl\n", - "Successfully installed redisvl-0.4.1\n", - "\n", - "\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", - "\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", - "Note: you may need to restart the kernel to use updated packages.\n" - ] - } - ], - "source": [ - "%pip install git+https://github.com/redis/redis-vl-python.git@0.5.0" + "%pip install -q sentence-transformers ranx \"redisvl>=0.6.0\"" ] }, { diff --git a/python-recipes/vector-search/00_redispy.ipynb b/python-recipes/vector-search/00_redispy.ipynb index ae1c19b2..b28f0b87 100644 --- a/python-recipes/vector-search/00_redispy.ipynb +++ b/python-recipes/vector-search/00_redispy.ipynb @@ -63,20 +63,33 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 24, "id": "c620286e", "metadata": {}, "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "huggingface/tokenizers: The current process just got forked, after parallelism has already been used. Disabling parallelism to avoid deadlocks...\n", + "To disable this warning, you can either:\n", + "\t- Avoid using `tokenizers` before the fork if possible\n", + "\t- Explicitly set the environment variable TOKENIZERS_PARALLELISM=(true | false)\n" + ] + }, { "name": "stdout", "output_type": "stream", "text": [ + "\n", + "\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.1\u001b[0m\n", + "\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", "Note: you may need to restart the kernel to use updated packages.\n" ] } ], "source": [ - "%pip install -q redis numpy sentence-transformers" + "%pip install -q \"redis>=5.0.5\" numpy sentence-transformers" ] }, { @@ -135,7 +148,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 1, "id": "aefda1d1", "metadata": {}, "outputs": [], @@ -161,18 +174,30 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 2, "id": "370c1fcc", "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "True" + ] + }, + "execution_count": 2, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "from redis import Redis\n", - "client = Redis.from_url(REDIS_URL)" + "client = Redis.from_url(REDIS_URL)\n", + "client.ping()" ] }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 3, "id": "458fc773", "metadata": {}, "outputs": [], @@ -185,7 +210,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 4, "id": "8d561462", "metadata": {}, "outputs": [ @@ -193,8 +218,10 @@ "name": "stderr", "output_type": "stream", "text": [ - "/Users/justin.cechmanek/.pyenv/versions/3.11.9/envs/redis-ai-res/lib/python3.11/site-packages/sentence_transformers/cross_encoder/CrossEncoder.py:11: TqdmExperimentalWarning: Using `tqdm.autonotebook.tqdm` in notebook mode. Use `tqdm.tqdm` instead to force console mode (e.g. in jupyter console)\n", - " from tqdm.autonotebook import tqdm, trange\n" + "/Users/robert.shelton/.pyenv/versions/3.11.9/lib/python3.11/site-packages/huggingface_hub/file_download.py:1142: FutureWarning: `resume_download` is deprecated and will be removed in version 1.0.0. Downloads always resume when possible. If you want to force a new download, use `force_download=True`.\n", + " warnings.warn(\n", + "/Users/robert.shelton/.pyenv/versions/3.11.9/lib/python3.11/site-packages/huggingface_hub/file_download.py:1142: FutureWarning: `resume_download` is deprecated and will be removed in version 1.0.0. Downloads always resume when possible. If you want to force a new download, use `force_download=True`.\n", + " warnings.warn(\n" ] } ], @@ -211,7 +238,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 5, "id": "9946a382", "metadata": {}, "outputs": [], @@ -227,21 +254,22 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 6, "id": "8797fcc6", "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "{'title': 'Explosive Pursuit',\n", + "{'id': 1,\n", + " 'title': 'Explosive Pursuit',\n", " 'genre': 'action',\n", " 'rating': 7,\n", " 'description': 'A daring cop chases a notorious criminal across the city in a high-stakes game of cat and mouse.',\n", - " 'vector': b'\\x9bf|=\\xa4a\\n;\\xb6\\x91\\xb7;*\\xcb~\\xbd\\x07e\\xce\\xbb\\xc9\\x16J=G\\xa7?=\\xcev\\x95\\x17\\xbe\\xc0 \\x05\\xb9&u\\xbf<0\\xe2b\\xba\\xd6\\xa6\\xa8\\xbdr\\xdc\\xec\\xbcWc%=\\xa6\\xe7r\\xbb\"OG=:(\\x85=s@\\xa2\\xbc/Z\\xd0\\xbdK%K\\xbd\\xb1\\xed\\x94\\xbc`\\xddH=\\xaa&F<\\xe0*\\xec<\\x88\\xd8\\x8d\\xbd\\xc5Z\\x98<\\x13\\xa3\\xa3=:g3\\xbd+\\xcd\\xbd\\xbd\\x90$\\xf7;\\xf8\\xf4z=\\x01\\xb5\\x8c=\\x8a\\x0e\\xc6\\xbdoI\\x90\\xbd\\x80\\x16\\xbd;u\\xe7\\x0c\\xbd\\xf32\\xc9\\xbc\\x8b\\xf8\\xbb\\xbcP&u\\xbb9\\x8f\\xca<\\x07\\x80J=\\x10\\xaf*=\\x96OU\\xbd\\xc9\\xf0\\x95\\xbc\\x10\\x02\\x19=\\x12\\xf4K<\\xc0\\xc2\\t=L\\x83\\xac=\\x98\\xd7\\xb8\\xbd\\xf7\\xb5\\x9c\\xbd9\\x85\\x18=\\x9fd&=73\\xf8<\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uec09dT=^Լ<\\x0c;\\x196(=\\x08\\x1b<\\x01=!\\x17<\\x0f.=yq=~\\x1a\\x1f:G0(H]X=d\\x10=Ge@[\\x06F<', 'title': 'John Wick', 'rating': '8'}, Document {'id': '6', 'payload': None, 'genre': 'action', 'description': 'Batman faces off against the Joker, a criminal mastermind who threatens to plunge Gotham into chaos.', 'vector': ':A%=Em5\\x0eGh=\\x035%\\x01P\\x1eq\\x1d\\x1c=N==\\r\\x04\\\\8E= ,==4\\x01G==(<\\x02/)=PK6\\x04Y螉\\x0eྲྀ8:2jt|=,\\x0c6\\x17am<&=\\t\\x18>_\\x108<\\x0f!lQ^\\x0e>1K=<*F\\x01Q.hЌg\\r\\x01<Ԭ<@<0\\r\\x11=\\rq\\rT\\'P=y\\x17ml>DM}=rH5=\\x0f\\x13Ϋ=D\\x03;\\rR=a=4=\\x13q\\x07=ޭ\\x01=\\x17<.J\\x01=Gy\\t\\x13S=\\'6k\\x00\\x07;Oؽf\\x08<2ݼ<(}E=M{JֽY=Vj\\x18A=CT@]=Jj<18\\x1a=ぎ=\\r8P{<.4Ž\\x0f=\\\\g==+D=Vce=6xUǽ-\\r+=O=,ü0C\\x05R=\\nrSZ=[L\\x01\\nnV=Ѝ\\x19W=:w=4v=C\\x1b@<:y;\\nh=ڙ=C\\uef1e=@ے=9_S8;e<\\x1d\\x1b=rDK-S새;\\t\\x16=\\x1a\\x18~=r6\\x19=r=1?;\\x16\\r\\x18\\x1e;<\\x15j4ߜP<\\nAR\\x06=ߕ$\\x11=hgv\\x18>\\x14ѽO=Ѷ<@6=\\x03o=\\t\\x01|>A=\\x00!.c3\\\\7L\\x01==-I ];ջͣ<[\\x15\\x0cҩ=Q\\x19Rk$\\x17Oc\\x11B}j\\x02\\roy=~=4==\\r-=(=Zҹ<`@j\\x1c(\\x1b=\\x10=(x:h#pI=x\\u05fb\\\\<\\x1d\\x1cY|\\x0c=Aˡ?\\x18\\x0f\\x04n=?5d\\'=d3;\\x06`ܻ\\x101=^)\\x0c\\x13B<\">=s\\x06=\\x08=̽|\\x1f!{=i\\x19Dm\\x192;<-ſ?[R@=|\\x0f%<\\x01ؕ4\\x13$=Ӽ\\x1c-F!ﵼ\\x01Hf{\\ue17d=\\x12TB<\\x064Ἥ\\x13:\\x11\\x1b_:2;W\\x0c=Xx;m=\\x02= <+*x=-\"P=:\\\\=k\\x0c=\\x12L42\\x15\\x17!q>s=|;\\x14\\x1eKj;>v\\x1e=!=d&=s<<\\x16<4\"\\x16\"u\\x0e>\\x0b\\x05Ɍ.kY-pض\\x12\\x19<[*\\x13=\\x1ej\\t\\x7f=]p<.\\x1f=0f~;%\\n_=?;\\x1eC\\x19W\\x04=FF<_s<;=B=վȤ\\x14r\\x00\\x0c0<\\na.t=s\\x19P$\\'%\\x19\\x05===\\x7fWE}A\\r\\r*<`\\x05=TF= ^=\\x0c0=FA;\\x17G\\x01%\\x05U%=\\x0ck5\\x08Hżb{$weight: 1}) | (@description:(%superhero%)=>{$weight: 10}))') \\\n", + " .return_fields(\"title\", \"genre\", \"rating\", \"description\") \\\n", + " .paging(0, 3) \\\n", + " .dialect(2)\n", + "\n", + "res = client.ft(index_name).search(query)\n", + "res.docs" + ] + }, + { + "cell_type": "code", + "execution_count": 21, "id": "1902b43b", "metadata": {}, "outputs": [ @@ -650,7 +769,7 @@ "True" ] }, - "execution_count": 20, + "execution_count": 21, "metadata": {}, "output_type": "execute_result" } @@ -663,7 +782,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3 (ipykernel)", + "display_name": "Python 3", "language": "python", "name": "python3" }, diff --git a/python-recipes/vector-search/resources/movies.json b/python-recipes/vector-search/resources/movies.json index 57c29d3c..1736f924 100644 --- a/python-recipes/vector-search/resources/movies.json +++ b/python-recipes/vector-search/resources/movies.json @@ -1,119 +1,139 @@ [ { + "id": 1, "title": "Explosive Pursuit", "genre": "action", "rating": 7, "description": "A daring cop chases a notorious criminal across the city in a high-stakes game of cat and mouse." }, { + "id": 2, "title": "Skyfall", "genre": "action", "rating": 8, "description": "James Bond returns to track down a dangerous new enemy who threatens global security." }, { + "id": 3, "title": "Fast & Furious 9", "genre": "action", "rating": 6, "description": "Dom and his crew face off against a high-tech enemy with advanced weapons and technology." }, { + "id": 4, "title": "Black Widow", "genre": "action", "rating": 7, "description": "Natasha Romanoff confronts her dark past and family ties as she battles a new enemy." }, { + "id": 5, "title": "John Wick", "genre": "action", "rating": 8, "description": "A retired hitman seeks vengeance against those who wronged him, leaving a trail of destruction in his wake." }, { + "id": 6, "title": "Mad Max: Fury Road", "genre": "action", "rating": 8, "description": "In a post-apocalyptic wasteland, Max teams up with Furiosa to escape a tyrant's clutches and find freedom." }, { + "id": 7, "title": "The Dark Knight", "genre": "action", "rating": 9, "description": "Batman faces off against the Joker, a criminal mastermind who threatens to plunge Gotham into chaos." }, { + "id": 8, "title": "Gladiator", "genre": "action", "rating": 8, "description": "A betrayed Roman general seeks revenge against the corrupt emperor who murdered his family." }, { + "id": 9, "title": "Inception", "genre": "action", "rating": 9, "description": "A thief who enters dreams to steal secrets faces his toughest mission yet, with reality itself at stake." }, { + "id": 10, "title": "The Avengers", "genre": "action", "rating": 8, "description": "Earth's mightiest heroes come together to stop an alien invasion that threatens the entire planet." }, { + "id": 11, "title": "Toy Story", "genre": "comedy", "rating": 8, "description": "Woody, a good-hearted cowboy doll who belongs to a young boy named Andy, sees his position as Andy's favorite toy jeopardized when his parents buy him a Buzz Lightyear action figure. Even worse, the arrogant Buzz thinks he's a real spaceman on a mission to return to his home planet." }, { + "id": 12, "title": "The Lego Movie", "genre": "comedy", "rating": 7, "description": "An ordinary Lego construction worker, thought to be the prophesied 'Special', is recruited to join a quest to stop an evil tyrant from gluing the Lego universe into eternal stasis." }, { + "id": 13, "title": "Aladdin", "genre": "comedy", "rating": 8, "description": "A kind-hearted street urchin and a power-hungry Grand Vizier vie for a magic lamp that has the power to make their deepest wishes come true." }, { + "id": 14, "title": "Finding Nemo", "genre": "comedy", "rating": 8, "description": "After his son is captured in the Great Barrier Reef and taken to Sydney, a timid clownfish sets out on a journey to bring him home." }, { + "id": 15, "title": "Shrek", "genre": "comedy", "rating": 8, "description": "A mean lord exiles fairytale creatures to the swamp of a grumpy ogre, who must go on a quest and rescue a princess for the lord in order to get his land back." }, { + "id": 16, "title": "The Incredibles", "genre": "comedy", "rating": 8, "description": "A family of undercover superheroes, while trying to live the quiet suburban life, are forced into action to save the world. Bob Parr (Mr. Incredible) and his wife Helen (Elastigirl) were among the world's greatest crime fighters, but now they must assume civilian identities and retreat to the suburbs to live a 'normal' life with their three children. However, the family's desire to help the world pulls them back into action when they face a new and dangerous enemy." }, { + "id": 17, "title": "Monsters, Inc.", "genre": "comedy", "rating": 8, "description": "In order to power the city, monsters have to scare children so that they scream. However, the children are toxic to the monsters, and after a child gets through, two monsters realize things may not be what they think." }, { + "id": 18, "title": "Despicable Me", "genre": "comedy", "rating": 7, "description": "When a criminal mastermind uses a trio of orphan girls as pawns for a grand scheme, he finds their love is profoundly changing him for the better." }, { + "id": 19, "title": "Madagascar", "genre": "comedy", "rating": 7, "description": "A group of animals who have spent all their life in a New York zoo end up in the jungles of Madagascar, and must adjust to living in the wild." }, { + "id": 20, "title": "The Princess Diaries", "genre": "comedy", "rating": 6,