autogen_ext.cache_store.redis#
- class RedisStore(redis_instance: Redis)[源代码]#
基础类:
CacheStore
[T
],Component
[RedisStoreConfig
]一个使用Redis作为底层存储的类型化CacheStore实现。有关使用示例,请参见
ChatCompletionCache
。- Parameters:
cache_instance – redis.Redis 的一个实例。 用户负责管理 Redis 实例的生命周期。
- classmethod _from_config(config: RedisStoreConfig) 自我 [源代码]#
从配置对象创建组件的新实例。
- Parameters:
config (T) – 配置对象。
- Returns:
Self – 组件的新实例。
- _to_config() RedisStoreConfig [源代码]#
导出配置,该配置将用于创建一个与此实例配置相匹配的组件新实例。
- Returns:
T – 组件的配置。
- component_config_schema#
- component_provider_override: ClassVar[str | 无] = 'autogen_ext.cache_store.redis.RedisStore'#
覆盖组件的提供商字符串。这应用于防止内部模块名称成为模块名称的一部分。
- pydantic model RedisStoreConfig[源代码]#
基础:
BaseModel
RedisStore 的配置
Show JSON schema
{ "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" } } }
- Fields: