Commit 696c91dfeca1a6acb58e3c25c11c867a8ebfff5b
1 parent
65e1d34e
fix:【AI】检索 documents 无数据时调用召回会报错
Showing
1 changed file
with
3 additions
and
0 deletions
yudao-module-ai/src/main/java/cn/iocoder/yudao/module/ai/service/knowledge/AiKnowledgeSegmentServiceImpl.java
| ... | ... | @@ -227,6 +227,9 @@ public class AiKnowledgeSegmentServiceImpl implements AiKnowledgeSegmentService |
| 227 | 227 | |
| 228 | 228 | // 2. 检索 |
| 229 | 229 | List<Document> documents = searchDocument(knowledge, reqBO); |
| 230 | + if (CollUtil.isEmpty(documents)) { | |
| 231 | + return ListUtil.empty(); | |
| 232 | + } | |
| 230 | 233 | |
| 231 | 234 | // 3.1 段落召回 |
| 232 | 235 | List<AiKnowledgeSegmentDO> segments = segmentMapper | ... | ... |