Create a RedisConfig object from a YAML file containing the index schema.
This class method creates a RedisConfig instance using a YAML file that
defines the structure of the Redis index.
from_yaml(
cls,
schema_path: str,
**kwargs: Any = {}
) -> RedisConfigExample:
from langchain_redis import RedisConfig
# Assuming 'index_schema.yaml' contains a valid index schema
config = RedisConfig.from_yaml(
schema_path="path/to/index_schema.yaml",
redis_url="redis://localhost:6379"
)
print(config.index_name) # Output: Name defined in YAML
print(config.storage_type) # Output: Storage type defined in YAML
Note:
IndexSchema.from_yaml() to parse
the YAML file.| Name | Type | Description |
|---|---|---|
schema_path* | str | Path to the YAML file containing the index schema definition. |
**kwargs | Any | Default: {}Additional keyword arguments to override or supplement the schema-derived settings. Common kwargs include:
|