|
@@ -9,6 +9,7 @@ import com.qmth.boot.core.ai.model.llm.score.AutoScoreModel;
|
|
import com.qmth.boot.core.ai.model.llm.score.AutoScoreRequest;
|
|
import com.qmth.boot.core.ai.model.llm.score.AutoScoreRequest;
|
|
import com.qmth.boot.core.ai.model.llm.score.AutoScoreResult;
|
|
import com.qmth.boot.core.ai.model.llm.score.AutoScoreResult;
|
|
import com.qmth.boot.core.ai.model.ocr.OcrType;
|
|
import com.qmth.boot.core.ai.model.ocr.OcrType;
|
|
|
|
+import com.qmth.boot.core.ai.model.ocr.ParseDocTaskResult;
|
|
import com.qmth.boot.core.ai.service.AiService;
|
|
import com.qmth.boot.core.ai.service.AiService;
|
|
import com.qmth.boot.core.retrofit.utils.SignatureInfo;
|
|
import com.qmth.boot.core.retrofit.utils.SignatureInfo;
|
|
import com.qmth.boot.core.retrofit.utils.UploadFile;
|
|
import com.qmth.boot.core.retrofit.utils.UploadFile;
|
|
@@ -59,17 +60,17 @@ public class AiApiDemoTest {
|
|
|
|
|
|
@Test
|
|
@Test
|
|
public void testAll() throws Exception {
|
|
public void testAll() throws Exception {
|
|
-
|
|
+
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- private void testOcr() throws Exception {
|
|
+ private void testOcrImage() throws Exception {
|
|
File file = new File("D:\\home\\test.png");
|
|
File file = new File("D:\\home\\test.png");
|
|
MultipartBody.Part part = UploadFile.build("image", file.getName(), file);
|
|
MultipartBody.Part part = UploadFile.build("image", file.getName(), file);
|
|
|
|
|
|
@@ -77,6 +78,20 @@ public class AiApiDemoTest {
|
|
System.out.println(result);
|
|
System.out.println(result);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private void testOrcDoc() throws Exception {
|
|
|
|
+ File file = new File("D:\\home\\大纲.pdf");
|
|
|
|
+ MultipartBody.Part part = UploadFile.build("file", file.getName(), file);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ String taskId = "task-rmebOA853Uk592w9uTOLqV8Wtffb3HhR";
|
|
|
|
+ ParseDocTaskResult parseDocTaskResult = ocrApiClient.parseDocTaskQuery(baseUrl, secret, taskId);
|
|
|
|
+ System.out.println(parseDocTaskResult.getStatus());
|
|
|
|
+ System.out.println(parseDocTaskResult.getContent());
|
|
|
|
+ }
|
|
|
|
+
|
|
private void autoScore() throws Exception {
|
|
private void autoScore() throws Exception {
|
|
AutoScoreRequest request = new AutoScoreRequest();
|
|
AutoScoreRequest request = new AutoScoreRequest();
|
|
request.setSubjectName("语文");
|
|
request.setSubjectName("语文");
|
|
@@ -156,18 +171,12 @@ public class AiApiDemoTest {
|
|
System.out.println(new JsonMapper().writeValueAsString(result));
|
|
System.out.println(new JsonMapper().writeValueAsString(result));
|
|
}
|
|
}
|
|
|
|
|
|
- private void chatTemplate() throws Exception {
|
|
|
|
- Map<String, Object> param = this.buildQuestionParam();
|
|
|
|
- ChatResult result = llmApiClient.chatTemplate(baseUrl, secret, LlmAppType.AUTO_GENERATE_QUESTION, param);
|
|
|
|
- System.out.println(new JsonMapper().writeValueAsString(result));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
private Map<String, Object> buildQuestionParam() {
|
|
private Map<String, Object> buildQuestionParam() {
|
|
return new HashMap<String, Object>() {{
|
|
return new HashMap<String, Object>() {{
|
|
put("courseName", "语文");
|
|
put("courseName", "语文");
|
|
put("questionTypeName", "多选题");
|
|
put("questionTypeName", "多选题");
|
|
- put("syllabusAttachment", true);
|
|
+ put("syllabus", "熟练掌握诗词");
|
|
- put("syllabusNotes", "熟练掌握诗词");
|
|
+ put("syllabusNotes", "");
|
|
put("knowledgePoint", "诗词");
|
|
put("knowledgePoint", "诗词");
|
|
put("knowledgeNotes", "作者出处");
|
|
put("knowledgeNotes", "作者出处");
|
|
|
|
|