-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor : open ai 관련 request, response 구조 수정
- open ai 응답 구조에 맞추어 클래스 구조 수정
- Loading branch information
Showing
2 changed files
with
21 additions
and
4 deletions.
There are no files selected for viewing
11 changes: 10 additions & 1 deletion
11
src/main/java/com/taehee/bot/global/feign/openai/dto/request/OpenAiRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,20 @@ | ||
package com.taehee.bot.global.feign.openai.dto.request; | ||
|
||
import com.taehee.bot.global.feign.openai.dto.Message; | ||
import com.taehee.bot.domain.question.model.Category; | ||
|
||
import java.util.List; | ||
|
||
public record OpenAiRequest( | ||
String model, | ||
List<Message> messages | ||
) { | ||
|
||
public record Message( | ||
String role, | ||
String content | ||
) { | ||
public Message(String role, Category categoryName) { | ||
this(role, categoryName + " 관련 백엔드 개발자 면접 질문 10개씩 한글로 번역해서 json 형식으로 줘"); | ||
} | ||
} | ||
} |
14 changes: 11 additions & 3 deletions
14
src/main/java/com/taehee/bot/global/feign/openai/dto/response/OpenAiResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,18 @@ | ||
package com.taehee.bot.global.feign.openai.dto.response; | ||
|
||
import com.taehee.bot.global.feign.openai.dto.Message; | ||
|
||
import java.util.List; | ||
|
||
public record OpenAiResponse( | ||
List<Message> choices | ||
List<Choice> choices | ||
) { | ||
|
||
public record Choice( | ||
Message message | ||
) { | ||
} | ||
|
||
public record Message( | ||
String content | ||
) { | ||
} | ||
} |