google模型添加http重试

This commit is contained in:
litianxiang
2025-10-08 13:08:14 +08:00
parent 3150f5ae57
commit 4fbacb37c1
2 changed files with 6 additions and 4 deletions

View File

@@ -767,6 +767,7 @@ public class GenerateServiceImpl extends ServiceImpl<GenerateMapper, Generate> i
.connectTimeout(30, TimeUnit.SECONDS) // 连接超时时间
.readTimeout(60, TimeUnit.SECONDS) // 读取超时时间
.writeTimeout(60, TimeUnit.SECONDS) // 写入超时时间
.retryOnConnectionFailure(true)
.build();
Request request = new Request.Builder()
.url(endpoint)
@@ -966,6 +967,7 @@ public class GenerateServiceImpl extends ServiceImpl<GenerateMapper, Generate> i
.connectTimeout(30, TimeUnit.SECONDS) // 连接超时时间
.readTimeout(60, TimeUnit.SECONDS) // 读取超时时间
.writeTimeout(60, TimeUnit.SECONDS) // 写入超时时间
.retryOnConnectionFailure(true)
.build();
Request request = new Request.Builder()
.url(endpoint)

View File

@@ -446,17 +446,17 @@ public class UserLikeGroupServiceImpl extends ServiceImpl<UserLikeGroupMapper, U
// 处理用户输入的提示词
String prompt = toProductImageDTO.getPrompt();
String advancedPrompt;
//nanobanana模型支持中文保证语义,使用这个模型的不翻译
//nanobanana模型支持中文保证语义,使用这个模型的不翻译
if (StringUtil.isNullOrEmpty(prompt)) {
advancedPrompt = "Transform this image into a realistic, studio-quality photograph."
+ "Pay attention to the size of the garment, the print, and the fabric texture. the white background. 8K, HDR, DOF, soft lighting" +
", high detail, high quality";
", high detail, high quality,Do not return the original image";
} else {
advancedPrompt = prompt + "Pay attention to the size of the garment, the print, and the fabric texture. the white background. 8K, HDR, DOF, soft lighting, high detail, high quality";
advancedPrompt = prompt + "Pay attention to the size of the garment, the print, and the fabric texture. the white background. 8K, HDR, DOF, soft lighting, high detail, high quality,Do not return the original image";
}
// 初始化基础提示词,确保生成高质量的真实图像
StringBuilder sb = new StringBuilder("The best quality, masterpiece, real image.");
if (!StringUtil.isNullOrEmpty(prompt)) {
if (!StringUtil.isNullOrEmpty(prompt)&&!advanced) {
// 调用Python服务进行提示词翻译中文转英文等
prompt = pythonService.promptTranslate(prompt);