Skip to content

Commit 588eeff

Browse files
fix(aws): handle image_url object format in block type extraction (#8143)
2 parents aca7e98 + 5dd9c6b commit 588eeff

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

libs/langchain-aws/src/common.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,11 @@ function convertLangChainContentBlockToConverseContentBlock<
297297
}
298298

299299
if (block.type === "image_url") {
300-
return extractImageInfo(block.image_url);
300+
return extractImageInfo(
301+
typeof block.image_url === "string"
302+
? block.image_url
303+
: block.image_url.url
304+
);
301305
}
302306

303307
if (block.type === "document" && block.document !== undefined) {

0 commit comments

Comments
 (0)