Get the name of the semantic cache index.
This method returns the name of the index used for the semantic cache in Redis.
name(
self,
) -> strExample:
from langchain_openai import OpenAIEmbeddings
cache = RedisSemanticCache(
embeddings=OpenAIEmbeddings(),
redis_url="redis://localhost:6379",
name="my_custom_cache"
)
index_name = cache.name()
print(f"The semantic cache is using index: {index_name}")
Note:
RedisSemanticCache.