diff --git a/libs/langchain-aws/src/common.ts b/libs/langchain-aws/src/common.ts index fbb3356e90e4..8b0d8e0d2e18 100644 --- a/libs/langchain-aws/src/common.ts +++ b/libs/langchain-aws/src/common.ts @@ -144,6 +144,17 @@ export function convertToConverseMessages(messages: BaseMessage[]): { return { text: block.text, }; + } else if ( + block.type === "document" && + block.document !== undefined + ) { + return { + document: block.document, + }; + } else if (block.type === "image" && block.image !== undefined) { + return { + image: block.image, + }; } else { throw new Error(`Unsupported content block type: ${block.type}`); }