Skip to content

RedisStore example in "Migration Guide for v0.2 to v0.4" #7084

@mhou7712

Description

@mhou7712

What is the doc issue?

The partial codes are from the AutoGen doc:

async def main():
    with tempfile.TemporaryDirectory() as tmpdirname:
        # Initialize the original client
        openai_model_client = OpenAIChatCompletionClient(model="gpt-4o")

        # Then initialize the CacheStore, in this case with diskcache.Cache.
        # You can also use redis like:
        # from autogen_ext.cache_store.redis import RedisStore
        # import redis
        # redis_instance = redis.Redis()
        # cache_store = RedisCacheStore[CHAT_CACHE_VALUE_TYPE](redis_instance)
        cache_store = DiskCacheStore[CHAT_CACHE_VALUE_TYPE](Cache(tmpdirname))
        cache_client = ChatCompletionCache(openai_model_client, cache_store)

About line:

cache_store = RedisCacheStore[CHAT_CACHE_VALUE_TYPE](redis_instance)

There is no class name called RedisCacheStore rather than RedisStore, should the code be like either in the following?

cache_store = RedisStore[CHAT_CACHE_VALUE_TYPE](redis_instance)

Thanks.

Link to the doc page, if applicable

https://microsoft.github.io/autogen/stable/user-guide/agentchat-user-guide/migration-guide.html#

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions