in server/src/main/java/com/epam/aidial/core/server/util/ProxyUtil.java [182:207]
private static void collectAttachedFilesFromCustomContent(JsonNode customContent, Consumer<String> consumer) {
if (customContent == null) {
return;
}
ArrayNode attachments = (ArrayNode) customContent.get("attachments");
if (attachments != null) {
for (int i = 0; i < attachments.size(); i++) {
JsonNode attachment = attachments.get(i);
collectAttachedFile(attachment, consumer);
}
}
ArrayNode stages = (ArrayNode) customContent.get("stages");
if (stages != null) {
for (int i = 0; i < stages.size(); i++) {
JsonNode stage = stages.get(i);
attachments = (ArrayNode) stage.get("attachments");
if (attachments == null) {
continue;
}
for (int j = 0; j < attachments.size(); j++) {
JsonNode attachment = attachments.get(j);
collectAttachedFile(attachment, consumer);
}
}
}
}