mirror of
https://github.com/Nezumi-2711/9router.git
synced 2026-09-22 13:38:31 +00:00
fix: support HTTP/HTTPS image URLs in Claude and Gemini translators (#344)
Previously only base64 data: URLs were handled in the OpenAI-to-Claude and OpenAI-to-Gemini request translators. HTTP/HTTPS image URLs were silently dropped, causing vision-capable models to respond with "I don't see any image."
This commit is contained in:
@@ -216,6 +216,11 @@ function getContentBlocksFromMessage(msg, toolNameMap = new Map()) {
|
||||
type: "image",
|
||||
source: { type: "base64", media_type: match[1], data: match[2] }
|
||||
});
|
||||
} else if (url.startsWith("http://") || url.startsWith("https://")) {
|
||||
blocks.push({
|
||||
type: "image",
|
||||
source: { type: "url", url }
|
||||
});
|
||||
}
|
||||
} else if (part.type === "image" && part.source) {
|
||||
blocks.push({ type: "image", source: part.source });
|
||||
|
||||
Reference in New Issue
Block a user