Skip to content

Commit

Permalink
refactor : open ai 관련 request, response 구조 수정
Browse files Browse the repository at this point in the history
- open ai 응답 구조에 맞추어 클래스 구조 수정
  • Loading branch information
ttaehee committed May 19, 2023
1 parent fe89734 commit f5fc3d1
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
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 형식으로 줘");
}
}
}
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
) {
}
}

0 comments on commit f5fc3d1

Please sign in to comment.