use different prompts for generation and refinements
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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<Reference> 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());
|
||||
|
||||
Reference in New Issue
Block a user