From 3a64c7195faa90538fbb3aee019dba6d66dab81a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B9=9B=E9=9C=B2=E5=85=88=E7=94=9F?= Date: Mon, 14 Apr 2025 21:01:36 +0800 Subject: [PATCH] community: redis tool typos fix (#30811) --- docs/docs/integrations/providers/redis.mdx | 2 +- docs/docs/integrations/vectorstores/redis.ipynb | 12 +++++++----- .../community/langchain_community/utilities/redis.py | 4 ++-- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/docs/docs/integrations/providers/redis.mdx b/docs/docs/integrations/providers/redis.mdx index 1850ca312e8..6a76e699f10 100644 --- a/docs/docs/integrations/providers/redis.mdx +++ b/docs/docs/integrations/providers/redis.mdx @@ -59,7 +59,7 @@ with the default values of "service-name = mymaster" and "db-number = 0" if not The service-name is the redis server monitoring group name as configured within the Sentinel. The current url format limits the connection string to one sentinel host only (no list can be given) and -booth Redis server and sentinel must have the same password set (if used). +both Redis server and sentinel must have the same password set (if used). #### Redis Cluster connection url diff --git a/docs/docs/integrations/vectorstores/redis.ipynb b/docs/docs/integrations/vectorstores/redis.ipynb index a3f4dafadee..93eb53337ff 100644 --- a/docs/docs/integrations/vectorstores/redis.ipynb +++ b/docs/docs/integrations/vectorstores/redis.ipynb @@ -120,7 +120,7 @@ "1. `redis://` - Connection to Redis standalone, unencrypted\n", "2. `rediss://` - Connection to Redis standalone, with TLS encryption\n", "3. `redis+sentinel://` - Connection to Redis server via Redis Sentinel, unencrypted\n", - "4. `rediss+sentinel://` - Connection to Redis server via Redis Sentinel, booth connections with TLS encryption\n", + "4. `rediss+sentinel://` - Connection to Redis server via Redis Sentinel, both connections with TLS encryption\n", "\n", "More information about additional connection parameters can be found in the [redis-py documentation](https://redis-py.readthedocs.io/en/stable/connections.html)." ] @@ -187,7 +187,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": null, "id": "b1b1eb90-5155-44ca-a8a7-b04b02d5e77c", "metadata": {}, "outputs": [], @@ -209,7 +209,7 @@ "# connection to redis standalone at localhost, db 0, no password but with TLS support\n", "redis_url = \"rediss://localhost:6379\"\n", "# connection to redis sentinel at localhost and default port, db 0, no password\n", - "# but with TLS support for booth Sentinel and Redis server\n", + "# but with TLS support for both Sentinel and Redis server\n", "redis_url = \"rediss+sentinel://localhost\"" ] }, @@ -254,7 +254,9 @@ "cell_type": "markdown", "id": "7f98392b", "metadata": {}, - "source": "To enable automated tracing of your model calls, set your [LangSmith](https://docs.smith.langchain.com/) API key:" + "source": [ + "To enable automated tracing of your model calls, set your [LangSmith](https://docs.smith.langchain.com/) API key:" + ] }, { "cell_type": "code", @@ -899,7 +901,7 @@ ] }, { - "name": "stdin", + "name": "stdout", "output_type": "stream", "text": [ "Please enter your OpenAI API key: ········\n" diff --git a/libs/community/langchain_community/utilities/redis.py b/libs/community/langchain_community/utilities/redis.py index 7877e6ae6cb..dc540a85398 100644 --- a/libs/community/langchain_community/utilities/redis.py +++ b/libs/community/langchain_community/utilities/redis.py @@ -99,7 +99,7 @@ def get_client(redis_url: str, **kwargs: Any) -> RedisType: correct redis server connection. The default service name is "mymaster". The optional second part of the path is the redis db number to connect to. - An optional username or password is used for booth connections to the rediserver + An optional username or password is used for both connections to the rediserver and the sentinel, different passwords for server and sentinel are not supported. And as another constraint only one sentinel instance can be given: @@ -148,7 +148,7 @@ def _redis_sentinel_client(redis_url: str, **kwargs: Any) -> RedisType: If username and/or password for authentication is given the same credentials are used for the Redis Sentinel as well as Redis Server. With this implementation using a redis url only it is not possible - to use different data for authentication on booth systems. + to use different data for authentication on both systems. """ import redis