|
@@ -115,11 +115,10 @@ public class LLMService {
|
|
|
""";
|
|
""";
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // 构建 vision 消息(多模态 content 数组)
|
|
|
|
|
|
|
+ // 构建 vision 消息(DashScope 原生多模态格式)
|
|
|
List<Map<String, Object>> contentParts = List.of(
|
|
List<Map<String, Object>> contentParts = List.of(
|
|
|
- Map.of("type", "image_url",
|
|
|
|
|
- "image_url", Map.of("url", "data:" + mimeType + ";base64," + imageBase64)),
|
|
|
|
|
- Map.of("type", "text", "text", prompt)
|
|
|
|
|
|
|
+ Map.of("image", "data:" + mimeType + ";base64," + imageBase64),
|
|
|
|
|
+ Map.of("text", prompt)
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
Map<String, Object> userMessage = Map.of("role", "user", "content", contentParts);
|
|
Map<String, Object> userMessage = Map.of("role", "user", "content", contentParts);
|
|
@@ -154,9 +153,8 @@ public class LLMService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
List<Map<String, Object>> contentParts = List.of(
|
|
List<Map<String, Object>> contentParts = List.of(
|
|
|
- Map.of("type", "image_url",
|
|
|
|
|
- "image_url", Map.of("url", "data:" + mimeType + ";base64," + imageBase64)),
|
|
|
|
|
- Map.of("type", "text", "text", prompt)
|
|
|
|
|
|
|
+ Map.of("image", "data:" + mimeType + ";base64," + imageBase64),
|
|
|
|
|
+ Map.of("text", prompt)
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
Map<String, Object> userMessage = Map.of("role", "user", "content", contentParts);
|
|
Map<String, Object> userMessage = Map.of("role", "user", "content", contentParts);
|
|
@@ -192,9 +190,8 @@ public class LLMService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
List<Map<String, Object>> contentParts = List.of(
|
|
List<Map<String, Object>> contentParts = List.of(
|
|
|
- Map.of("type", "video_url",
|
|
|
|
|
- "video_url", Map.of("url", "data:" + mimeType + ";base64," + videoBase64)),
|
|
|
|
|
- Map.of("type", "text", "text", prompt)
|
|
|
|
|
|
|
+ Map.of("video", "data:" + mimeType + ";base64," + videoBase64),
|
|
|
|
|
+ Map.of("text", prompt)
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
Map<String, Object> userMessage = Map.of("role", "user", "content", contentParts);
|
|
Map<String, Object> userMessage = Map.of("role", "user", "content", contentParts);
|
|
@@ -226,9 +223,8 @@ public class LLMService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
List<Map<String, Object>> contentParts = List.of(
|
|
List<Map<String, Object>> contentParts = List.of(
|
|
|
- Map.of("type", "video_url",
|
|
|
|
|
- "video_url", Map.of("url", "data:" + mimeType + ";base64," + videoBase64)),
|
|
|
|
|
- Map.of("type", "text", "text", prompt)
|
|
|
|
|
|
|
+ Map.of("video", "data:" + mimeType + ";base64," + videoBase64),
|
|
|
|
|
+ Map.of("text", prompt)
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
Map<String, Object> userMessage = Map.of("role", "user", "content", contentParts);
|
|
Map<String, Object> userMessage = Map.of("role", "user", "content", contentParts);
|