Skip to content

Allow for PDFs to be attached #5

@Southporter

Description

@Southporter

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);
   },
 });

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions