Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for PDFs to be attached #5

Open
Southporter opened this issue Nov 25, 2024 · 0 comments
Open

Allow for PDFs to be attached #5

Southporter opened this issue Nov 25, 2024 · 0 comments

Comments

@Southporter
Copy link

Currently Battleground only allows for images to be added to a chat or a prompt. It would be great to support more file types.

The Bedrock UI allows the following:
csv, html, doc(x), pdf, md, txt, xls(x)

I think that all this requires is for useFilePicker to allow these types

 const { openFilePicker } = useFilePicker({
   multiple: false,
   accept: ["image/*", ".pdf", ".txt"], // And more could be added.
   readAs: "DataURL",
   onFilesSuccessfullySelected: ({ filesContent }) => {
     if (!filesContent || filesContent.length === 0) return;
     const imageData = { name: filesContent[0].name, dataUrl: filesContent[0].content };
     addAttachmentToPrompt(imageData);
   },
 });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant