Skip to content

Commit 5818535

Browse files
committed
add compatibility handling
1 parent bf928ad commit 5818535

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/core/tools/accessMcpResourceTool.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,11 @@ export async function accessMcpResourceTool(
7373

7474
resourceResult?.contents.forEach((item) => {
7575
if (item.mimeType?.startsWith("image") && item.blob) {
76-
images.push(`data:${item.mimeType};base64,` + item.blob)
76+
if (item.mimeType.startsWith("data:")) {
77+
images.push(item.blob)
78+
} else {
79+
images.push(`data:${item.mimeType};base64,` + item.blob)
80+
}
7781
}
7882
})
7983

0 commit comments

Comments
 (0)