autogen_ext.cache_store.redis#
- class RedisStore(redis_instance: Redis)[source]#
基类:
CacheStore
[T
],Component
[RedisStoreConfig
]一个类型化的 CacheStore 实现,它使用 redis 作为底层存储。有关用法示例,请参见
ChatCompletionCache
。- 参数:
cache_instance – redis.Redis的一个实例。用户负责管理 Redis 实例的生命周期。
- classmethod _from_config(config: RedisStoreConfig) Self [source]#
从配置对象创建一个组件的新实例。
- 参数:
config (T) – 配置对象。
- 返回:
Self – 组件的新实例。
- _to_config() RedisStoreConfig [source]#
转储创建与此实例的配置匹配的组件新实例所需的配置。
- 返回:
T – 组件的配置。
- component_config_schema#
- component_provider_override: ClassVar[str | None] = 'autogen_ext.cache_store.redis.RedisStore'#
覆盖组件的提供程序字符串。这应该用于防止内部模块名称成为模块名称的一部分。
- pydantic model RedisStoreConfig[source]#
基类:
BaseModel
RedisStore 的配置
显示 JSON 模式
{ "title": "RedisStoreConfig", "description": "Configuration for RedisStore", "type": "object", "properties": { "host": { "default": "localhost", "title": "Host", "type": "string" }, "port": { "default": 6379, "title": "Port", "type": "integer" }, "db": { "default": 0, "title": "Db", "type": "integer" }, "username": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Username" }, "password": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Password" }, "ssl": { "default": false, "title": "Ssl", "type": "boolean" }, "socket_timeout": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "default": null, "title": "Socket Timeout" } } }
- 字段: