Create a RedisConfig object with a specified metadata schema.
This class method creates a RedisConfig instance using a provided metadata schema, which defines the structure of additional metadata fields in the Redis index.
Example:
.. code-block:: python
from langchain_redis import RedisConfig
metadata_schema = [ {"name": "author", "type": "text"}, {"name": "publication_date", "type": "numeric"}, {"name": "tags", "type": "tag", "separator": ","} ]
config = RedisConfig.with_metadata_schema( metadata_schema, index_name="book_index", redis_url="redis://localhost:6379", embedding_dimensions=1536 )
print(config.metadata_schema) # Output: The metadata schema list print(config.index_name) # Output: book_index
Note:
A list of dictionaries defining the metadata fields. Each dictionary should contain at least 'name' and 'type' keys.
Additional keyword arguments to configure the RedisConfig instance. Common kwargs include: