Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save dbanksdesign/810d5b10e2389b81883181b9b6ae7ea0 to your computer and use it in GitHub Desktop.
Save dbanksdesign/810d5b10e2389b81883181b9b6ae7ea0 to your computer and use it in GitHub Desktop.
Amplify AI Kit document patch package
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