|
@@ -5,8 +5,8 @@ import com.sxtvs.api.chatgpt.dto.CompletionsParamsDto;
|
|
|
import com.sxtvs.api.chatgpt.dto.CompletionsRequestDto;
|
|
|
import com.sxtvs.api.chatgpt.dto.CompletionsResponseDto;
|
|
|
import com.sxtvs.api.chatgpt.dto.GptResponse;
|
|
|
-import com.sxtvs.core.sls.AliyunLogger;
|
|
|
import com.sxtvs.core.advice.BizException;
|
|
|
+import com.sxtvs.core.sls.AliyunLogger;
|
|
|
import lombok.Cleanup;
|
|
|
import lombok.SneakyThrows;
|
|
|
import org.apache.commons.io.IOUtils;
|
|
@@ -22,7 +22,6 @@ import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
|
|
import java.nio.charset.StandardCharsets;
|
|
|
import java.util.concurrent.ArrayBlockingQueue;
|
|
|
-import java.util.stream.Collectors;
|
|
|
|
|
|
@Service
|
|
|
public class ChatGptService {
|
|
@@ -82,7 +81,12 @@ public class ChatGptService {
|
|
|
public CompletionsResponseDto completions(@RequestBody CompletionsRequestDto dto) {
|
|
|
var paramsDto = new CompletionsParamsDto(dto.toText());
|
|
|
var params = objectMapper.writeValueAsString(paramsDto);
|
|
|
- logger.info("key", "completions", "request", params, "dto", objectMapper.writeValueAsString(dto));
|
|
|
+ logger.info("key", "completions",
|
|
|
+ "request", params,
|
|
|
+ "dto", objectMapper.writeValueAsString(dto),
|
|
|
+ "userId", dto.getUserId(),
|
|
|
+ "userName", dto.getUserName()
|
|
|
+ );
|
|
|
|
|
|
var result = request(params);
|
|
|
|