Skip to content

Commit 032bdb9

Browse files
authored
Merge pull request #99 from prgrms-web-devcourse-final-project/feat-dashboard
fix : 감정분석 예외 및 프롬프트 수정
2 parents 20592b6 + dbaf277 commit 032bdb9

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/main/java/com/grepp/teamnotfound/app/controller/api/dashboard/DashboardApiController.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ public ResponseEntity<?> getDashboardProfile(
6262
String analysis = aiAnalysisService.getAiAnalysis(petId, date);
6363
if (analysis == null) {
6464
List<String> notes = dashboardService.getWeekNotes(petId, date);
65+
if (notes.isEmpty()) {
66+
response.setAiAnalysis("최근 관찰노트가 없어서 감정분석을 받기 어려워요!");
67+
return ResponseEntity.ok(response);
68+
}
6569
String geminiResponse = geminiService.generateAnalysis(notes);
6670
AiAnalysis aiAnalysis = aiAnalysisService.createAnalysis(petId, geminiResponse);
6771
analysis = aiAnalysis.getContent();

src/main/java/com/grepp/teamnotfound/app/model/recommend/GeminiService.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,6 @@ private String createAnalysisPrompt(List<String> notes) {
157157
"notes": [%s]
158158
}
159159
160-
# 출력 형식 (Output Format)
161-
{
162-
"recommendation": "여기에 강아지 입장에서 기분 요약"
163-
}
164160
""", notes.toString()
165161
);
166162
}

0 commit comments

Comments
 (0)