From 75932e12e99feae25f31b13a3b71dd706aea6b9f Mon Sep 17 00:00:00 2001 From: su080915 Date: Thu, 28 Nov 2024 15:44:57 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20api=20endpoint=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../oof/api/controller/ChatGPTController.java | 54 +------------------ 1 file changed, 2 insertions(+), 52 deletions(-) diff --git a/src/main/java/com/project/oof/api/controller/ChatGPTController.java b/src/main/java/com/project/oof/api/controller/ChatGPTController.java index 072749a..7613f59 100644 --- a/src/main/java/com/project/oof/api/controller/ChatGPTController.java +++ b/src/main/java/com/project/oof/api/controller/ChatGPTController.java @@ -1,31 +1,21 @@ package com.project.oof.api.controller; import com.project.oof.dto.ChatCompletionDto; -import com.project.oof.dto.CompletionDto; import com.project.oof.service.ChatGPTService; import lombok.extern.slf4j.Slf4j; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; -import java.util.List; import java.util.Map; -/** - * ChatGPT API - * - * @author : lee - * @fileName : ChatGPTController - * @since : 12/29/23 - */ + @Slf4j @RestController -@RequestMapping(value = "/api/v1/chatGpt") +@RequestMapping(value = "/api") public class ChatGPTController { private final ChatGPTService chatGPTService; @@ -34,46 +24,6 @@ public ChatGPTController(ChatGPTService chatGPTService) { this.chatGPTService = chatGPTService; } - /** - * [API] ChatGPT 모델 리스트를 조회합니다. - */ - @GetMapping("/modelList") - public ResponseEntity>> selectModelList() { - List> result = chatGPTService.modelList(); - return new ResponseEntity<>(result, HttpStatus.OK); - } - - /** - * [API] ChatGPT 유효한 모델인지 조회합니다. - * - * @param modelName - * @return - */ - @GetMapping("/model") - public ResponseEntity> isValidModel(@RequestParam(name = "modelName") String modelName) { - Map result = chatGPTService.isValidModel(modelName); - return new ResponseEntity<>(result, HttpStatus.OK); - } - - /** - * [API] Legacy ChatGPT 프롬프트 명령을 수행합니다. : gpt-3.5-turbo-instruct, babbage-002, davinci-002 - * - * @param completionDto {} - * @return ResponseEntity> - */ - @PostMapping("/legacyPrompt") - public ResponseEntity> selectLegacyPrompt(@RequestBody CompletionDto completionDto) { - log.debug("param :: " + completionDto.toString()); - Map result = chatGPTService.legacyPrompt(completionDto); - return new ResponseEntity<>(result, HttpStatus.OK); - } - - /** - * [API] 최신 ChatGPT 프롬프트 명령어를 수행합니다. : gpt-4, gpt-4 turbo, gpt-3.5-turbo - * - * @param chatCompletionDto - * @return - */ @PostMapping("/prompt") public ResponseEntity> selectPrompt(@RequestBody ChatCompletionDto chatCompletionDto) { log.debug("param :: " + chatCompletionDto.toString());