autogen_ext.cache_store.redis#
- class RedisStore(redis_instance: Redis)[源代码]#
基类:
CacheStore
[T
],Component
[RedisStoreConfig
]一个使用 Redis 作为底层存储的类型化 CacheStore 实现。 使用示例请参见
ChatCompletionCache
。- 参数:
cache_instance -- redis.Redis 的实例。 用户需自行管理 Redis 实例的生命周期。
- classmethod _from_config(config: RedisStoreConfig) Self [源代码]#
从配置对象创建组件的新实例。
- 参数:
config (T) -- 配置对象。
- Returns:
Self -- 组件的新实例。
- _to_config() RedisStoreConfig [源代码]#
导出当前组件实例的配置,该配置可用于创建具有相同配置的新组件实例。
- Returns:
T -- 组件的配置。
- component_config_schema#
RedisStoreConfig
的别名
- component_provider_override: ClassVar[str | None] = 'autogen_ext.cache_store.redis.RedisStore'#
覆盖组件的provider字符串。这应该用于防止内部模块名称成为模块名称的一部分。
- pydantic model RedisStoreConfig[源代码]#
基类:
BaseModel
RedisStore 的配置
Show JSON schema
{ "title": "RedisStoreConfig", "description": "RedisStore \u7684\u914d\u7f6e", "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: