mirror of
https://gitee.com/mateos/mateclaw.git
synced 2026-09-16 04:18:17 +08:00
fix(agent): resolve image path from mediaId for IM channel multimodal injection
This commit is contained in:
parent
af40fbd7de
commit
91cd03c0da
@ -285,11 +285,14 @@ public abstract class BaseAgent {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 解析媒体文件路径:先尝试原始 path,再尝试拼接工作目录
|
// 解析媒体文件路径:先尝试 path,再尝试 mediaId(IM 渠道下载后存在 mediaId 中),再拼接工作目录
|
||||||
Path mediaPath = resolveImagePath(part.getPath());
|
Path mediaPath = resolveImagePath(part.getPath());
|
||||||
|
if (mediaPath == null && part.getMediaId() != null) {
|
||||||
|
mediaPath = resolveImagePath(part.getMediaId());
|
||||||
|
}
|
||||||
if (mediaPath == null) {
|
if (mediaPath == null) {
|
||||||
log.warn("[{}] {} file not found for attachment: {}, path: {}",
|
log.warn("[{}] {} file not found for attachment: {}, path: {}, mediaId: {}",
|
||||||
agentName, isVideo ? "Video" : "Image", part.getFileName(), part.getPath());
|
agentName, isVideo ? "Video" : "Image", part.getFileName(), part.getPath(), part.getMediaId());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user