Merge bcb0269ef6 into 09be5d45d5
This commit is contained in:
commit
7773d8e30d
@ -39,6 +39,14 @@ function extractImages(message: unknown): ImageBlock[] {
|
||||
? data
|
||||
: `data:${mediaType};base64,${data}`;
|
||||
images.push({ url });
|
||||
} else if (typeof b.data === "string" && typeof b.mimeType === "string") {
|
||||
// Handle tool result format: { type: "image", data: "base64...", mimeType: "image/png" }
|
||||
const data = b.data as string;
|
||||
const mimeType = b.mimeType as string;
|
||||
const url = data.startsWith("data:")
|
||||
? data
|
||||
: `data:${mimeType};base64,${data}`;
|
||||
images.push({ url });
|
||||
} else if (typeof b.url === "string") {
|
||||
images.push({ url: b.url });
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user