|
@@ -13,6 +13,8 @@ import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
+import java.nio.charset.StandardCharsets;
|
|
|
+
|
|
|
@RestController
|
|
|
public class ChatGptController {
|
|
|
|
|
@@ -28,7 +30,7 @@ public class ChatGptController {
|
|
|
.bodyString(objectMapper.writeValueAsString(paramsDto), ContentType.APPLICATION_JSON)
|
|
|
.execute()
|
|
|
.returnContent()
|
|
|
- .toString();
|
|
|
+ .asString(StandardCharsets.UTF_8);
|
|
|
var gptResponse = objectMapper.readValue(response, GptResponse.class);
|
|
|
var completionsResponseDto = new CompletionsResponseDto();
|
|
|
var text = gptResponse.getChoices().stream().map(GptResponse.ChoicesDTO::getText).findFirst().orElse("");
|