add support for 'document' file attachments#3
Open
pniyongabo wants to merge 2 commits into
Open
Conversation
Description: - add support for all file extensions supported by AWS bedrock converse API - refactor file type classification to use consistent 'image'/'document' categories - add `is_previewable` property to FileData class to identify previewable content - simplify code with centralized file type utilities in Types.tsx Testing: - tested by attaching `pdf|csv|doc|docx|xls|xlsx|html|txt|md` files References: - AWS Bedrock converse API for docs attachments: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_DocumentBlock.html
tahouse
reviewed
Aug 16, 2025
Comment on lines
+16
to
+23
| pdf: { | ||
| mimeTypes: ['application/pdf'], | ||
| extensions: ['.pdf'] | ||
| }, | ||
| markdown: { | ||
| mimeTypes: ['text/markdown', 'text/x-markdown'], | ||
| extensions: ['.md'] | ||
| }, |
Owner
There was a problem hiding this comment.
why do we treat these differently than documents below? In other parts of code we seem to include pdf/md as both documents?
Contributor
Author
There was a problem hiding this comment.
my bad, i kind of overlooked this as I was trying to keep the preview functionality in components/ChatInput.tsx that depended on checking whether file.type was md or pdf. I have added a new commit to consolidate pdf/md with other document types, while keeping the preview logic separate
Description: - Simplify file types to 'image' and 'document' categories - Add `isPreviewableDocument` function utility function in types.tsx - 1st attempt to make the preview logic identical between Python and TypeScript Testing: - Tested: pdf|csv|doc|docx|xls|xlsx|html|txt|md file attachments References: - AWS Bedrock converse API for docs attachments: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_DocumentBlock.html
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
is_previewableproperty to FileData class to identify previewable contentTesting:
pdf|csv|doc|docx|xls|xlsx|html|txt|mdfilesReferences: