sync update from LAN repo (source dhk-1 @ 3b1ec5b4)

This commit is contained in:
gozeros committed 2026-11-05 10:56:34 +08:00
1 parent da6521b6cb
commit 264e2200d6
995 files changed
+148105 -13399

No files matched your search

@@ -102,10 +102,22 @@ class MemoryManager:
# ---- 系统提示词组装 / 召回 -------------------------------------------
def build_system_prompt(self) -> str:
"""收集所有 provider 的静态系统提示词块。"""
def build_system_prompt(
self,
*,
excluded_provider_names: set[str] | frozenset[str] | None = None,
) -> str:
"""收集所有 provider 的静态系统提示词块。
``excluded_provider_names`` 只影响本次静态提示组装,不会移除或
关闭 provider。调用方因此可以屏蔽冲突的旧路由说明,同时完整保留
用户记忆、动态召回和写回生命周期。
"""
blocks: list[str] = []
excluded = excluded_provider_names or set()
for provider in self._providers:
if provider.name in excluded:
continue
try:
block = provider.system_prompt_block()
except Exception as exc: # noqa: BLE001