memoryscope.core.config

class memoryscope.core.config.Arguments(language: Literal['cn', 'en'] = 'cn', thread_pool_max_workers: int = 5, memory_chat_class: str = 'cli_memory_chat', chat_stream: bool | None = None, human_name: str = 'user', assistant_name: str = 'AI', consolidate_memory_interval_time: int | None = 1, reflect_and_reconsolidate_interval_time: int | None = 15, worker_params: Dict[str, dict] = <factory>, generation_backend: str = 'dashscope_generation', generation_model: str = 'qwen-max', generation_params: dict = <factory>, embedding_backend: str = 'dashscope_generation', embedding_model: str = 'text-embedding-v2', embedding_params: dict = <factory>, rank_backend: str = 'dashscope_rank', rank_model: str = 'gte-rerank', rank_params: dict = <factory>, es_index_name: str = 'memory_index', es_url: str = 'http://localhost:9200', retrieve_mode: str = 'dense', enable_ranker: bool = False, enable_today_contra_repeat: bool = True, enable_long_contra_repeat: bool = False, output_memory_max_count: int = 20)[源代码]

基类:object

language: Literal['cn', 'en'] = 'cn'
thread_pool_max_workers: int = 5
memory_chat_class: str = 'cli_memory_chat'
chat_stream: bool | None = None
human_name: str = 'user'
assistant_name: str = 'AI'
consolidate_memory_interval_time: int | None = 1
reflect_and_reconsolidate_interval_time: int | None = 15
worker_params: Dict[str, dict]
generation_backend: str = 'dashscope_generation'
generation_model: str = 'qwen-max'
generation_params: dict
embedding_backend: str = 'dashscope_generation'
embedding_model: str = 'text-embedding-v2'
embedding_params: dict
rank_backend: str = 'dashscope_rank'
rank_model: str = 'gte-rerank'
rank_params: dict
es_index_name: str = 'memory_index'
es_url: str = 'http://localhost:9200'
retrieve_mode: str = 'dense'
enable_ranker: bool = False
enable_today_contra_repeat: bool = True
enable_long_contra_repeat: bool = False
output_memory_max_count: int = 20
__init__(language: ~typing.Literal['cn', 'en'] = 'cn', thread_pool_max_workers: int = 5, memory_chat_class: str = 'cli_memory_chat', chat_stream: bool | None = None, human_name: str = 'user', assistant_name: str = 'AI', consolidate_memory_interval_time: int | None = 1, reflect_and_reconsolidate_interval_time: int | None = 15, worker_params: ~typing.Dict[str, dict] = <factory>, generation_backend: str = 'dashscope_generation', generation_model: str = 'qwen-max', generation_params: dict = <factory>, embedding_backend: str = 'dashscope_generation', embedding_model: str = 'text-embedding-v2', embedding_params: dict = <factory>, rank_backend: str = 'dashscope_rank', rank_model: str = 'gte-rerank', rank_params: dict = <factory>, es_index_name: str = 'memory_index', es_url: str = 'http://localhost:9200', retrieve_mode: str = 'dense', enable_ranker: bool = False, enable_today_contra_repeat: bool = True, enable_long_contra_repeat: bool = False, output_memory_max_count: int = 20) None
class memoryscope.core.config.ConfigManager(config_path: str | None = None, arguments: Arguments | None = None, demo_config_name: str = 'demo_config_zh.yaml', **kwargs)[源代码]

基类:object

__init__(config_path: str | None = None, arguments: Arguments | None = None, demo_config_name: str = 'demo_config_zh.yaml', **kwargs)[源代码]
read_config(config_path: str)[源代码]
static update_ignore_none(config, new_config_dict)[源代码]
static update_global_by_arguments(config: dict, arguments: Arguments)[源代码]
static update_memory_chat_by_arguments(config: dict, arguments: Arguments)[源代码]
static update_memory_service_by_arguments(config: dict, arguments: Arguments)[源代码]
static update_worker_by_arguments(config: dict, arguments: Arguments)[源代码]
static update_model_by_arguments(config: dict, arguments: Arguments)[源代码]
static update_memory_store_by_arguments(config: dict, arguments: Arguments)[源代码]
update_config_by_arguments(arguments: Arguments)[源代码]
add_node_object(node: str, name: str, config: dict)[源代码]
pop_node_object(node: str, name: str)[源代码]
clear_node_all(node: str)[源代码]
dump_config(file_type: Literal['json', 'yaml'] = 'yaml', file_path: str | None = None) str[源代码]