Open SpaceTTAngel opened 1 year ago
Save the PDF file and open it with Notepad then you'll see why Auto-GPT was unable to read it.
PDFs are a major pain and will likely require a PDF extractor library and OCR to get all the important information out, math equations in particular are difficult.
Could be useful to implement something like that ?
import PyPDF2
pdffileobj=open('1.pdf','rb')
pdfreader=PyPDF2.PdfFileReader(pdffileobj)
x=pdfreader.numPages
pageobj=pdfreader.getPage(x+1)
text=pageobj.extractText()
file1=open(r"C:\Users\SIDDHI\AppData\Local\Programs\Python\Python38\1.txt","a") file1.writelines(text)
I can personally recommend PyMuPDF: https://pymupdf.readthedocs.io/en/latest/
def read_pdf(path: str) -> Generator[str, None, None]:
flags = fitz.TEXT_PRESERVE_WHITESPACE | fitz.TEXT_INHIBIT_SPACES | fitz.TEXT_DEHYPHENATE | fitz.TEXT_MEDIABOX_CLIP
with fitz.Document(path) as doc:
for page in doc:
yield page.get_textpage(flags=flags).extractText(sort=True)
seems worth a plugin later on
May be worth doing a title edit to: "Add a PDF plugin to read pdfs from the browser"
ChatPDF is a useful plugin that allows agents to ask questions through chat. I personally uploaded my profile to ChatPDF and it responded to questions effectively. My profile even contains diagrams.
Migrate to Auto-GPT-Plugins
迁移到自动 GPT 插件
https://github.com/Significant-Gravitas/Auto-GPT-Plugins,Is there an instruction manual for this plugin?
⚠️ Search for existing issues first ⚠️
Which Operating System are you using?
Windows
GPT-3 or GPT-4?
GPT-4
Steps to reproduce 🕹
Auto GPT is not able to analyze urls pages what ends with .pdf, for example:
https://www.nasa.gov/sites/default/files/atoms/files/2015_nasa_technology_roadmaps_ta_3_space_power_energy_storage_final.pdf
Every time it is observed the following log
DevTools listening on ws://127.0.0.1:58166/devtools/browser/f20cd7e3-fffc-4243-a948-0ca83d0a31b3 [10212:7268:0419/141719.510:ERROR:device_event_log_impl.cc(222)] [14:17:19.510] USB: usb_device_handle_win.cc:1046 Failed to read descriptor from node connection: Un dispositivo collegato al sistema non Þ in funzione. (0x1F) [10212:7268:0419/141719.517:ERROR:device_event_log_impl.cc(222)] [14:17:19.517] USB: usb_device_handle_win.cc:1046 Failed to read descriptor from node connection: Un dispositivo collegato al sistema non Þ in funzione. (0x1F) SYSTEM: Command browse_website returned: ('Answer gathered from website: Error: No text to summarize \n \n Links: []', <selenium.webdriver.chrome.webdriver.WebDriver (session="8bc1bce877b79a5e19efacaa584b64a2")>)
Current behavior 😯
Auto-GPT is not able to read correctly the webpages that contains .pdf files
Expected behavior 🤔
Auto-GPT should be able to read correctly the webpages that ends with .pdf
Your prompt 📝
Your Logs 📒