diff --git a/.changeset/fluffy-fireants-doubt.md b/.changeset/fluffy-fireants-doubt.md new file mode 100644 index 00000000000..fe62e6ade2a --- /dev/null +++ b/.changeset/fluffy-fireants-doubt.md @@ -0,0 +1,5 @@ +--- +"@aws-amplify/ui-react-ai": patch +--- + +fix(ai): remove unnecessary use of Buffer diff --git a/packages/react-ai/src/components/AIConversation/views/Controls/FieldControl.tsx b/packages/react-ai/src/components/AIConversation/views/Controls/FieldControl.tsx index 4f3ccdd00e5..d44b1e0606c 100644 --- a/packages/react-ai/src/components/AIConversation/views/Controls/FieldControl.tsx +++ b/packages/react-ai/src/components/AIConversation/views/Controls/FieldControl.tsx @@ -168,7 +168,7 @@ export const FieldControl: FieldControl = () => { const fileContent: ConversationMessageContent = { image: { format: getImageTypeFromMimeType(file.type), - source: { bytes: Uint8Array.from(Buffer.from(buffer)) }, + source: { bytes: new Uint8Array(buffer) }, }, }; submittedContent.push(fileContent);