chore: 完成知识库迁移与检索验证收口

This commit is contained in:
2026-07-11 19:30:08 +08:00
parent 872233adc6
commit 16fa9d06c2
3 changed files with 87 additions and 5 deletions

View File

@@ -30,10 +30,6 @@ export default defineConfig({
allowedHosts: ["qa.huiyushuyuan.cn"],
host: "0.0.0.0",
port: 5174,
hmr: {
protocol: "ws",
clientPort: 80,
},
proxy: {
"/api": {
target: "http://backend:8100",

View File

@@ -274,7 +274,11 @@ class KnowledgeAgentService:
selected = [item_id for score, item_id in ranked if score >= 0.04][:4]
if business and not selected:
selected = [item_id for _, item_id in ranked[:3]]
return business or bool(selected), selected, "涉及课程/老师/业务知识" if business else "问题与知识目录主题相关"
if business:
return True, selected, "涉及课程/老师/业务知识"
if selected:
return True, selected, "问题与知识目录主题相关"
return False, [], "问题与当前知识目录无关,无需调用知识库"
@staticmethod
def _query_terms(question: str) -> list[str]: