diff --git a/backend/src/main/java/com/indie/dto/LLMOptions.java b/backend/src/main/java/com/indie/dto/LLMOptions.java index 7ec8904..6b39af6 100644 --- a/backend/src/main/java/com/indie/dto/LLMOptions.java +++ b/backend/src/main/java/com/indie/dto/LLMOptions.java @@ -10,7 +10,7 @@ import lombok.Data; public class LLMOptions { @Builder.Default - private double temperature = 0.7; + private double temperature = 0.9; @Builder.Default private int maxTokens = 4096; diff --git a/backend/src/main/java/com/indie/service/LLMService.java b/backend/src/main/java/com/indie/service/LLMService.java index b7fbfa2..e82686c 100644 --- a/backend/src/main/java/com/indie/service/LLMService.java +++ b/backend/src/main/java/com/indie/service/LLMService.java @@ -39,18 +39,21 @@ public class LLMService { private final ReferenceService referenceService; private final MongoTemplate mongoTemplate; private final String systemPrompt; + private final String refinerPrompt; public LLMService(LLMFactory llmFactory, LLMResponseParser responseParser, ReferenceService referenceService, MongoTemplate mongoTemplate, ResourceLoader resourceLoader, - @Value("${indie.llm.system-prompt-path:classpath:prompts/site-generator.txt}") String promptPath) { + @Value("${indie.llm.system-prompt-path:classpath:prompts/site-generator.txt}") String promptPath, + @Value("${indie.llm.refiner-prompt-path:classpath:prompts/site-refiner.txt}") String refinerPath) { this.llmFactory = llmFactory; this.responseParser = responseParser; this.referenceService = referenceService; this.mongoTemplate = mongoTemplate; this.systemPrompt = loadSystemPrompt(resourceLoader, promptPath); + this.refinerPrompt = loadSystemPrompt(resourceLoader, refinerPath); } public SiteStructure generateSite(UUID userId, UUID siteId, String prompt, List references) { @@ -81,7 +84,7 @@ public class LLMService { LLMOptions options = LLMOptions.builder() .temperature(0.5) .build(); - LLMResult result = callLLM(systemPrompt, combinedPrompt, references, options); + LLMResult result = callLLM(refinerPrompt, combinedPrompt, references, options); log.info("LLM refinement completed: model={}, latency={}ms, tokens={}+{}", result.getModel(), result.getLatencyMs(), result.getPromptTokens(), result.getCompletionTokens());