Skip to content

Commit

Permalink
πŸ“ :: tag만
Browse files Browse the repository at this point in the history
  • Loading branch information
gurdl0525 committed Nov 19, 2023
1 parent b6a169c commit 50e810f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,5 @@ data class ChattingWithGPTRequest(

@field:NotNull(message = "null일 수 μ—†μŠ΅λ‹ˆλ‹€.")
@field:NotEmpty(message = "λΉ„μ–΄μžˆμ„ 수 μ—†μŠ΅λ‹ˆλ‹€.")
val tagList: MutableList<String>?,

@field:Size(max = 1000, message = "1000자λ₯Ό λ„˜μ„ 수 μ—†μŠ΅λ‹ˆλ‹€.")
@field:NotBlank(message = "null일 수 μ—†μŠ΅λ‹ˆλ‹€.")
val text: String?
val tagList: MutableList<String>?
)
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ class DiaryServiceImpl(
) : DiaryService {

private companion object {
const val M_SET1 = "λ„ˆμ˜ 이름은 μ˜€λˆ„μ΄μ΄κ³  직업은 상담사야.\nμ•„λž˜ λ¦¬μŠ€νŠΈλŠ” λ‚΄κ°€ μ„ νƒν•œ 감정이야.\n"
const val M_SET2 = "λ‚΄κ°€ ν•˜κ³ μ‹Άμ€ 말은 λ‹€μŒκ³Ό κ°™μ•„.\n"
const val M_SET = "λ„ˆμ˜ 이름은 μ˜€λˆ„μ΄μ΄κ³  직업은 상담사야.\nμ•„λž˜ λ¦¬μŠ€νŠΈλŠ” λ‚΄κ°€ μ„ νƒν•œ 감정이야.\n"
const val M_SET2 = "\nλ‚΄ 감정을 λΆ„μ„ν•˜κ³  μ†”λ£¨μ…˜μ„ μ œκ³΅ν•΄μ€˜."
}

@Transactional
Expand Down Expand Up @@ -89,10 +89,9 @@ class DiaryServiceImpl(

override fun chattingWithGPT(req: ChattingWithGPTRequest): ChattingResponse {
val res = gptClient.getGPTQuery(
GPTQueryRequest(arrayOf(Message(M_SET1 + req.text!!.toString() + M_SET2 + req.text)))
GPTQueryRequest(arrayOf(Message(M_SET + req.tagList.toString() + M_SET2)))
)

return ChattingResponse(res.choice[0].message.content)
return ChattingResponse(res.choices[0].message.content)
}

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package com.example.onui.infra.feign.gpt.dto.response

data class GPTResponse (
val choice: MutableList<Choice>
val choices: MutableList<Choice>
)

0 comments on commit 50e810f

Please sign in to comment.