sync: 鍚屾灞€鍩熺綉鏈€鏂颁唬鐮?(source master @ b69568e4)
This commit is contained in:
1 parent
4f7f07504a
commit
8bc8b0e082
1651 files changed
+278599
-11416
No files matched your search
+14
-2
@@ -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
|
||||
|
||||
Reference in new issue
Block a user