from_existing_index(
cls,
index_name: str,
redis: Redis
) -> RedisConfigCreate a RedisConfig object from an existing Redis index.
This class method creates a RedisConfig instance based on the configuration of an existing index in Redis. It's useful for connecting to and working with pre-existing Redis vector store indexes.
Example:
.. code-block:: python
from redis import Redis from langchain_redis import RedisConfig
redis_client = Redis.from_url("redis://localhost:6379")
config = RedisConfig.from_existing_index( index_name="my_existing_index", redis_client=redis_client )
print(config.index_name) # Output: my_existing_index print(config.from_existing) # Output: True
Note: