- 分支内容对齐 qyqy_develop b6ec3aa,树完全一致(同步后 git diff 为空) - 覆盖本轮全部交付:客服 Agent 重构(安全路由 / 五出口 / 记忆与画像 / RAG 全链路) + 开发文档 62 份编号体系(D1.1 v1.17 索引) + 新增 D2.10-客服Agent端到端答辩文档-2026-09-21.html - 基线:e239eb7(2026-09-17 品牌口径统一快照),本提交为其直接后继
17 lines
692 B
Python
17 lines
692 B
Python
class KnowledgeRuntimeConfig:
|
|
DEFAULT_ROUTES = {
|
|
"basic_explain": ("fin_basic_collection", 5),
|
|
"faq": ("fin_faq_collection", 3),
|
|
"product_inquiry": ("fin_product_collection", 5),
|
|
"policy_explain": ("fin_policy_collection", 5),
|
|
}
|
|
|
|
def __init__(self, *, vector_dim: int = 1024, similarity_threshold: float = 0.60) -> None:
|
|
self.routes = dict(self.DEFAULT_ROUTES)
|
|
self.vector_dim = vector_dim
|
|
self.similarity_threshold = similarity_threshold
|
|
|
|
def route(self, intent: str) -> tuple[str, int] | None:
|
|
"""Return the collection route used by the retrieval compatibility layer."""
|
|
return self.routes.get(intent)
|