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.
from_kwargs(
cls: Type[RedisConfig],
**kwargs: Any = {},
) -> RedisConfigExample:
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| Name | Type | Description |
|---|---|---|
**kwargs | Any | Default: {}Keyword arguments that match Common kwargs include:
|