|
@@ -48,8 +48,9 @@ public class AiApiImpl implements AiApi {
|
|
public String dataDual(DifyReqDTO createReqVO) {
|
|
public String dataDual(DifyReqDTO createReqVO) {
|
|
Map<String, Object> inputs = new HashMap<>();
|
|
Map<String, Object> inputs = new HashMap<>();
|
|
String apiKey = DictFrameworkUtils.parseDictDataValue("ai_key", "数据提取");
|
|
String apiKey = DictFrameworkUtils.parseDictDataValue("ai_key", "数据提取");
|
|
- List<Map<String, Object>> images = new ArrayList<>();
|
|
|
|
|
|
+
|
|
if (CollUtil.isNotEmpty(createReqVO.getImages())) {
|
|
if (CollUtil.isNotEmpty(createReqVO.getImages())) {
|
|
|
|
+ List<Map<String, Object>> images = new ArrayList<>();
|
|
for (String image : createReqVO.getImages()) {
|
|
for (String image : createReqVO.getImages()) {
|
|
Map<String, Object> variableValue = new HashMap<>();
|
|
Map<String, Object> variableValue = new HashMap<>();
|
|
variableValue.put("transfer_method", "remote_url");
|
|
variableValue.put("transfer_method", "remote_url");
|
|
@@ -61,13 +62,14 @@ public class AiApiImpl implements AiApi {
|
|
inputs.put("images", images);
|
|
inputs.put("images", images);
|
|
}
|
|
}
|
|
if (CollUtil.isNotEmpty(createReqVO.getDocs())) {
|
|
if (CollUtil.isNotEmpty(createReqVO.getDocs())) {
|
|
- for (String image : createReqVO.getImages()) {
|
|
|
|
|
|
+ List<Map<String, Object>> docsList = new ArrayList<>();
|
|
|
|
+ for (String docs : createReqVO.getDocs()) {
|
|
Map<String, Object> variableValue = new HashMap<>();
|
|
Map<String, Object> variableValue = new HashMap<>();
|
|
variableValue.put("transfer_method", "remote_url");
|
|
variableValue.put("transfer_method", "remote_url");
|
|
- variableValue.put("url", image);
|
|
|
|
|
|
+ variableValue.put("url", docs);
|
|
variableValue.put("type", "document");
|
|
variableValue.put("type", "document");
|
|
- images.add(variableValue);
|
|
|
|
- inputs.put("docs", images);
|
|
|
|
|
|
+ docsList.add(variableValue);
|
|
|
|
+ inputs.put("docs", docsList);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|