diff --git a/src/main/java/com/northtecom/visatrack/api/service/impl/ChatGPTService.java b/src/main/java/com/northtecom/visatrack/api/service/impl/ChatGPTService.java index c828834..6ac7b0f 100644 --- a/src/main/java/com/northtecom/visatrack/api/service/impl/ChatGPTService.java +++ b/src/main/java/com/northtecom/visatrack/api/service/impl/ChatGPTService.java @@ -107,7 +107,7 @@ public class ChatGPTService { */ private String getChatGPTContent(String content) { log.debug(">>>>>>>> ChatGPT Content Call"); - OpenAiService service = new OpenAiService("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"); + OpenAiService service = new OpenAiService("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", 30); CompletionRequest completionRequest = new CompletionRequestBuilder().setModel("text-davinci-003") .setPrompt(content) .setMaxTokens(500) @@ -120,7 +120,6 @@ public class ChatGPTService { content = service.createCompletion(completionRequest).getChoices().get(0).getText(); - return content; } diff --git a/src/test/java/com/northtecom/visatrack/api/OpenAiTest.java b/src/test/java/com/northtecom/visatrack/api/OpenAiTest.java index 46bd1e9..3a231eb 100644 --- a/src/test/java/com/northtecom/visatrack/api/OpenAiTest.java +++ b/src/test/java/com/northtecom/visatrack/api/OpenAiTest.java @@ -43,12 +43,12 @@ class OpenAiTest { } -// @Test + @Test public void testToWeChatMessage() { - OpenAiService service = new OpenAiService("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"); + OpenAiService service = new OpenAiService("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", 30); CompletionRequest completionRequest = new CompletionRequestBuilder() - .setPrompt("Python") + .setPrompt("雷达与热成像等其他技术监测火灾效果对比") .setModel("text-davinci-003") .setMaxTokens(1000) .setEcho(true)