Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

import java.time.LocalDate;
import java.util.HashMap;
import java.util.Map;

Expand Down Expand Up @@ -62,6 +63,7 @@ private String buildPrompt(IdeaAnalysisRequestDto dto) {
variables.put("technicalChallenges", dto.getTechnicalChallenges());
variables.put("targetCompletionDate",
dto.getTargetCompletionDate() != null ? dto.getTargetCompletionDate().toString() : "미정");
variables.put("today", LocalDate.now().toString());

return promptLoader.loadPrompt(PROMPT_PATH, variables);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ public Map<String, Object> buildIdeaAnalysisSchema() {
.filter(rf -> rf.getRole() != Role.OTHER)
.map(Enum::name)
.collect(Collectors.toList());

return Map.of(
"type", "object",
"properties", Map.of(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.nect.api.domain.analysis.util;


import lombok.extern.slf4j.Slf4j;
import org.springframework.core.io.ClassPathResource;
import org.springframework.stereotype.Component;
import org.springframework.util.StreamUtils;
Expand All @@ -11,7 +10,7 @@
import java.nio.file.Files;
import java.util.Map;

@Slf4j

@Component
public class PromptLoader {

Expand All @@ -28,7 +27,7 @@ public String loadPrompt(String promptPath, Map<String, String> variables) {
String value = entry.getValue() != null ? entry.getValue() : "";
result = result.replace(placeholder, value);
}
log.info("빌드된 프롬프트 앞부분: {}", result.substring(0, Math.min(500, result.length())));

return result;

} catch (IOException e) {
Expand Down
6 changes: 6 additions & 0 deletions nect-api/src/main/resources/prompts/idea-analysis.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@
- 목표 완료일: {{targetCompletionDate}}

---
## 분석 규칙
- 오늘 날짜는 {{today}}입니다.
- total_weeks는 반드시 8주 이상 12주 이하로 설정하세요.

---
- total_weeks는 반드시 8주 이상 12주 이하로 설정하세요.
5. **주차별 로드맵**:
- **⚠️ 중요: total_weeks 값만큼 정확히 모든 주차의 로드맵을 생성해야 합니다.**
- **예: total_weeks가 12라면 week_number 1부터 12까지 총 12개의 로드맵 객체를 생성하세요.**
Expand Down