Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 리뷰를 생성한다 #13

Merged
merged 7 commits into from
Jan 30, 2025
Merged

feat: 리뷰를 생성한다 #13

merged 7 commits into from
Jan 30, 2025

Conversation

inpink
Copy link
Member

@inpink inpink commented Jan 28, 2025

요약

  • 리뷰를 생성하는 API를 개발합니다
  • 리뷰 스타일 3가지를 추가합니다
  • Prompt의 command를 추가합니다
    • 해시 태그도 반영합니다
    • 음식점 뿐만아니라 모든 영수증 리뷰를 작성할 수 있는 프롬프트를 추가합니다
image
  • 비동기 스트리밍 방식을 사용하고, 클라이언트에서 주기적으로 폴링할 수 있다는 요구사항 존재 => LLM 응답올 때마다 매번 DB에 Insert하면 => 한 번의 리뷰 생성 요청에서 최대 100번까지도 디스크 IO 발생 => 성능 개선을 위해 캐싱합니다
image

어떻게 구현했는지

  • 요청 바디를 담을 CreateReviewRequest dto 추가
  • device id 헤더로 받아서 Review에 저장
  • ReCreateReviewFacade참고하여 CreateReviewFacade 작성
    • Review 객체 생성하고 비동기로 LLM API 호출한 뒤 ID만 바로 응답
    • Review 객체 생성 시 Prompt에서 일치하는 ReviewStyle를 기반으로 command를 조회해서 LLM 호출 시 사용
  • 프롬프트는 DB에서 관리하고, 프롬프트(promptCommand) 및 해시태그(hashtags)를 LLM 호출 시 System에 넣어 보냄
  • text라는 이름의 필드가 여러 곳에서 사용되어, 생성된 리뷰인지/프롬프트 명령어인지/ocr 영수증 추출물인지 헷갈려서 이름을 변경

다음 계획

  • 인메모리 캐싱 => Redis로 이전
  • 테스트 코드 더 추가
  • 캐싱 조회 기능은 다음 엔지니어 회의 때 캐싱 전략 회의 후 추가

이슈번호

close #5

@inpink inpink requested a review from devxb as a code owner January 28, 2025 13:49
@inpink inpink self-assigned this Jan 28, 2025
Copy link
Collaborator

@devxb devxb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

최고네용 :) 👍 👍

@devxb devxb self-requested a review January 30, 2025 14:12
@inpink inpink merged commit 2a8bfb6 into main Jan 30, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: 리뷰를 생성한다.
2 participants