Easily Submit PDFs and Word Files using this incredible plugin! #chatgpt #openai #plugin
How to Get Chat CPT File Uploader Extension to Read Microsoft Word and PDF Files
In this video, the presenter shows how to get the Chat CPT file uploader extension to read Microsoft Word and PDF files. The presenter explains that two separate libraries are needed for this process.
Required Libraries
- The mammoth.js library is required to read office files.
- The pdf.js library is required to read PDF files.
Testing the Libraries
- Before adding the prompt, test the content.js code from the prompt in a browser console.
- Select a Word document or a PDF file and check for errors.
Adding Prompt and Updating Code
- Copy and paste the provided prompt into the content.js file.
- Submit the prompt with a request for a manifest file that includes pdf.worker.min.js and pdf.min.js in the content script section.
- Save both content.js and manifest.json files.
Understanding Manifest File
- The Manifest file acts as a boss that gathers all scripts together.
- When someone clicks on the button and uploads a PDF or document file, content.js found gets ran. If it doesn't know how to handle it, it goes back to Manifest which tells it which libraries can be used.
- Ensure that icon.png is listed in the project files and referenced in the Manifest file.
- The size of icon.png can be changed to 128 for better visibility on Chrome extensions page.
Conclusion
The presenter demonstrates how to get the Chat CPT file uploader extension to read Microsoft Word and PDF files by adding two required libraries, testing them, adding a prompt, updating code, understanding the Manifest file, and saving all necessary files.
Setting up PDF and Word file upload
In this section, the speaker sets up the ability to upload PDF and Word files to Chacha BT.
Setting up PDF file upload
- The Chrome plugin is refreshed to enable PDF file uploads.
- The speaker clicks on the button that appears after refreshing the page.
- The PDF file is successfully uploaded.
Setting up Word file upload
- The speaker types out a script for reading Word files using mammoth.browser.min.js library.
- The code snippet is copied into content.jscript.
- An error occurs when checking if everything is working fine in content.js, which is resolved by commenting out a line of code.
- The manifest.json file is checked for proper permissions and updated with the correct path for the library.
- The mammoth Library file is imported into the folder and added to the Chrome plugin webpage.
- An error occurs when trying to open a Word document, which prompts copying all errors and submitting them into chat gbt for analysis.
Uploading both PDF and Word files
- After receiving feedback from Chacha BT, an updated script for uploading both PDF and Word files is provided by Chad Teeth.
- Content.js is replaced with the new script provided by Chad Teeth, which enables successful uploading of both PDF and Word documents to Chacha BT through the Chrome plugin webpage.