Skip to content

Commit

Permalink
Feat : endpoint url test로 수정 & Key 공개 실수 force push
Browse files Browse the repository at this point in the history
  • Loading branch information
nonaninona committed Jan 7, 2024
1 parent 5fa6a01 commit d850757
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class ChatController {

@Value("${OPEN_AI_KEY}")
private String OPEN_AI_KEY;
@PostMapping("/ask")
@PostMapping("/testAsk")
public ResponseEntity<String> ask(@RequestBody Map<String, String> prompt) {
RestTemplate restTemplate = new RestTemplate();
String apiUrl = "https://api.openai.com/v1/chat/completions";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class OpenAIController {
@Autowired
private final OpenAIService openAIService;

@GetMapping("/gpt")
@GetMapping("/testGpt")
public ResponseEntity<?> openAI() {
try {
return ResponseEntity.ok().body(openAIService.getCompletion("안녕"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
@Controller
public class UserController {

@GetMapping("/chat")
@GetMapping("/testChat")
public String chat() {
return "redirect:/chat.html";
return "redirect:/testChat.html";
}
@GetMapping("/user")
public String user() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
<script>
async function sendToOpenAI(message) {
try {
const response = await fetch('/ask', {
const response = await fetch('/testAsk', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
Expand Down

0 comments on commit d850757

Please sign in to comment.