Created
March 3, 2025 19:20
-
-
Save dbanksdesign/810d5b10e2389b81883181b9b6ae7ea0 to your computer and use it in GitHub Desktop.
Amplify AI Kit document patch package
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/node_modules/@aws-amplify/graphql-api-construct/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/bedrock_converse_adapter.js b/node_modules/@aws-amplify/graphql-api-construct/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/bedrock_converse_adapter.js | |
index 7baea6d..402d497 100644 | |
--- a/node_modules/@aws-amplify/graphql-api-construct/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/bedrock_converse_adapter.js | |
+++ b/node_modules/@aws-amplify/graphql-api-construct/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/bedrock_converse_adapter.js | |
@@ -92,8 +92,17 @@ class BedrockConverseAdapter { | |
}, | |
}, | |
}); | |
- } | |
- else { | |
+ } else if (contentElement.document) { | |
+ messageContent.push({ | |
+ document: { | |
+ format: contentElement.document.format, | |
+ name: contentElement.document.name, | |
+ source: { | |
+ bytes: Buffer.from(contentElement.document.source.bytes, "base64") | |
+ } | |
+ } | |
+ }); | |
+ } else { | |
// Otherwise type conforms to Bedrock's type and it's safe to cast. | |
messageContent.push(contentElement); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment