fix:允许图生图不带提示词
This commit is contained in:
@@ -1221,7 +1221,7 @@ public class GenerateServiceImpl extends ServiceImpl<GenerateMapper, Generate> i
|
|||||||
String style = generateDTO.getText().substring(0, firstCommaIndex).trim();
|
String style = generateDTO.getText().substring(0, firstCommaIndex).trim();
|
||||||
|
|
||||||
String prompt = generateDTO.getText().substring(firstCommaIndex + 1).trim();
|
String prompt = generateDTO.getText().substring(firstCommaIndex + 1).trim();
|
||||||
prompt = getPrintboardPrompt(style, prompt,modelName);
|
prompt = getPrintboardPrompt(style, prompt,modelName,isUseImage);
|
||||||
modelAndPromptMap.put(ModelConstants.PROMPT, prompt);
|
modelAndPromptMap.put(ModelConstants.PROMPT, prompt);
|
||||||
|
|
||||||
|
|
||||||
@@ -1570,7 +1570,7 @@ public class GenerateServiceImpl extends ServiceImpl<GenerateMapper, Generate> i
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private String getPrintboardPrompt(String style, String userInput, String modelName) {
|
private String getPrintboardPrompt(String style, String userInput, String modelName, boolean isUseImage) {
|
||||||
String systemPrompt = null;
|
String systemPrompt = null;
|
||||||
String prompt;
|
String prompt;
|
||||||
|
|
||||||
@@ -1601,7 +1601,11 @@ public class GenerateServiceImpl extends ServiceImpl<GenerateMapper, Generate> i
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (userInput == null || userInput.trim().isEmpty()) {
|
if (userInput == null || userInput.trim().isEmpty()) {
|
||||||
throw new BusinessException("prompt null");
|
if (isUseImage){
|
||||||
|
prompt = "Theme: Image content" + "\nRequirement: " + systemPrompt;
|
||||||
|
}else {
|
||||||
|
throw new BusinessException("prompt null");
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
prompt = "Theme: " + userInput.trim() + "\nRequirement: " + systemPrompt;
|
prompt = "Theme: " + userInput.trim() + "\nRequirement: " + systemPrompt;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user