from_kwargs(
cls: Type[RedisConfig],
**kwargs: Any = {},
) -> | Name | Type | Description |
|---|---|---|
**kwargs | Any | Default: {} |
Create a RedisConfig object with default values, overwritten by provided kwargs.
This class method allows for flexible creation of a RedisConfig object, using default values where not specified and overriding with any provided keyword arguments. If a 'schema' argument is provided, it will be set as 'index_schema' in the config.
Example:
.. code-block:: python
from langchain_redis import RedisConfig
config = RedisConfig.from_kwargs( index_name="my_custom_index", redis_url="redis://custom-host:6379", distance_metric="COSINE", embedding_dimensions=768 )
print(config.index_name) # Output: my_custom_index print(config.distance_metric) # Output: COSINE
Keyword arguments that match RedisConfig attributes. These will override default values. Common kwargs include: