feat:新增记忆测试、检索工具与服务
新增完整的长期记忆支持及测试:引入中文记忆检索提示词、query_long_term_memory 检索工具、记忆服务与记忆流程服务,以及 WebUI 的记忆路由。新增大规模测试套件(包括单元测试与基准/在线测试),覆盖聊天历史摘要、知识获取器、事件(episode)生成、写回机制以及用户画像检索等功能。 更新多个模块以集成记忆检索能力(包括 knowledge fetcher、chat summarizer、memory_retrieval、person_info、config/legacy 迁移以及 WebUI 路由),并移除遗留的 lpmm 知识模块。这些变更完成了记忆运行时的接入,同时为基准测试提供嵌入适配器的 mock,并支持新测试与工具所需的导入与 episode 处理流程。
This commit is contained in:
35
pytests/A_memorix_test/test_legacy_config_migration.py
Normal file
35
pytests/A_memorix_test/test_legacy_config_migration.py
Normal file
@@ -0,0 +1,35 @@
|
||||
from src.config.legacy_migration import try_migrate_legacy_bot_config_dict
|
||||
|
||||
|
||||
def test_legacy_learning_list_with_numeric_fourth_column_is_migrated():
|
||||
payload = {
|
||||
"expression": {
|
||||
"learning_list": [
|
||||
["qq:123456:group", "enable", "disable", "0.5"],
|
||||
["", "disable", "enable", "0.1"],
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
result = try_migrate_legacy_bot_config_dict(payload)
|
||||
|
||||
assert result.migrated is True
|
||||
assert "expression.learning_list" in result.reason
|
||||
assert result.data["expression"]["learning_list"] == [
|
||||
{
|
||||
"platform": "qq",
|
||||
"item_id": "123456",
|
||||
"rule_type": "group",
|
||||
"use_expression": True,
|
||||
"enable_learning": False,
|
||||
"enable_jargon_learning": False,
|
||||
},
|
||||
{
|
||||
"platform": "",
|
||||
"item_id": "",
|
||||
"rule_type": "group",
|
||||
"use_expression": False,
|
||||
"enable_learning": True,
|
||||
"enable_jargon_learning": False,
|
||||
},
|
||||
]
|
||||
Reference in New Issue
Block a user