Commit a07e844f authored by alex yao's avatar alex yao

feat:知识库分片长度限制

parent d65ef99e
...@@ -297,6 +297,7 @@ public class KnowledgeRestImpl implements KnowledgeRest { ...@@ -297,6 +297,7 @@ public class KnowledgeRestImpl implements KnowledgeRest {
Assert.notNull(dto.getChunkContent()); Assert.notNull(dto.getChunkContent());
Assert.notNull(dto.getChunkRelationId()); Assert.notNull(dto.getChunkRelationId());
Assert.notNull(dto.getKdId()); Assert.notNull(dto.getKdId());
Assert.isTrue(dto.getChunkContent().length() <= 1200);
knowledgeService.updateKnowledgeChunkDoc(dto.getKdId(), dto.getChunkRelationId(), dto.getChunkContent()); knowledgeService.updateKnowledgeChunkDoc(dto.getKdId(), dto.getChunkRelationId(), dto.getChunkContent());
} }
...@@ -305,6 +306,7 @@ public class KnowledgeRestImpl implements KnowledgeRest { ...@@ -305,6 +306,7 @@ public class KnowledgeRestImpl implements KnowledgeRest {
Assert.notNull(dto.getChunkContent()); Assert.notNull(dto.getChunkContent());
Assert.notNull(dto.getKdId()); Assert.notNull(dto.getKdId());
Assert.notNull(dto.getChunkSort()); Assert.notNull(dto.getChunkSort());
Assert.isTrue(dto.getChunkContent().length() <= 1200);
knowledgeService.addKnowledgeChunk(dto.getKdId(), dto.getChunkContent(), dto.getChunkSort()); knowledgeService.addKnowledgeChunk(dto.getKdId(), dto.getChunkContent(), dto.getChunkSort());
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment