Implement scoped real knowledge retrieval

This commit is contained in:
2026-07-08 11:46:09 +08:00
parent ca50fa437c
commit ac72b6a94a
10 changed files with 192 additions and 88 deletions

View File

@@ -69,7 +69,7 @@ def debug_agent(
raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail="模型不存在")
scopes = _agent_knowledge_scopes(db, payload.knowledgeIds)
chunks = FeishuKnowledgeService.retrieve(payload.question, scopes)
chunks = FeishuKnowledgeService.retrieve(payload.question, scopes, db)
prompt = _build_agent_debug_prompt(payload.promptContent, payload.question, chunks)
rag_result = RagResult(question=payload.question, knowledge_scopes=scopes, chunks=chunks, prompt=prompt)
result = ModelClientService.debug_model(