Skip to content

Commit

Permalink
feat: 첫문장 받기만하는 API 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
pingowl committed Jul 27, 2024
1 parent 37c5dd9 commit 82d16de
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/main/java/mychat/controller/GPTController.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@ public class GPTController {
private String apiUrl;
private final RestTemplate restTemplate;


@GetMapping("/chat/{roomId}")
public String chat(@PathVariable("roomId") String roomId){
@GetMapping("/chat")
public String chat(){
String prompt = "릴레이로 소설 작성할건데 소설의 첫 줄 써줄래? 20자 이내로";

GPTRequest request = new GPTRequest(
Expand All @@ -51,7 +50,13 @@ public String chat(@PathVariable("roomId") String roomId){
sb.append('\n'); // 줄바꿈 추가
}
firstSentence = sb.toString();
return firstSentence;

}

@GetMapping("/chat/{roomId}")
public String chat(@PathVariable("roomId") String roomId){
String firstSentence = chat();
chatRoomService.setFirstSentence(roomId, firstSentence);
return firstSentence;

Expand Down

0 comments on commit 82d16de

Please sign in to comment.