Commit a406ab1b authored by alex yao's avatar alex yao

fix:智能出题

parent 101a5b4f
......@@ -101,9 +101,9 @@ public class ExaminationServiceImpl implements ExaminationService {
largeModelResponse.setMessages(messages);
largeModelResponse.setStream(true);
largeModelResponse.setMaxTokens(32768);
largeModelResponse.setThinking(new Thinking() {{
setType("disabled");
}});
// largeModelResponse.setThinking(new Thinking() {{
// setType("disabled");
// }});
largeModelResponse.setUser("GENERATE_EXAMINATION");
try {
......@@ -343,7 +343,7 @@ public class ExaminationServiceImpl implements ExaminationService {
}
String content = prompt.replace("${file_content}", fileContent)
.replace("${content}", generateExaminationEntity.getContent())
.replace("${content}", StringUtils.isBlank(generateExaminationEntity.getContent()) && StringUtils.isBlank(fileContent) ? generateExaminationEntity.getTitle() : generateExaminationEntity.getContent())
.replace("${number}", generateExaminationEntity.getN().toString())
.replace("${total_score}", generateExaminationEntity.getTotalScore().toString())
.replace("${level}", generateExaminationEntity.getLevel())
......
......@@ -51,7 +51,8 @@ public class ExaminationRestImpl implements ExaminationRest {
// Assert.notBlank(generateExaminationDto.getPositions());
Assert.notEmpty(generateExaminationDto.getQuestionType());
Assert.notNull(generateExaminationDto.getN());
Assert.isTrue(generateExaminationDto.getN() <= 20,"总题数不可大于20题");
Assert.isTrue(generateExaminationDto.getN() <= 20, "总题数不可大于20题");
Assert.isTrue(generateExaminationDto.getN() <= generateExaminationDto.getTotalScore() ,"总题数不可大于总分数");
UserBaseEntity currentUser = BlContext.getCurrentUser();
GenerateExaminationEntity generateExaminationEntity = new GenerateExaminationEntity();
......
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