assafelovic / gpt-researcher

GPT based autonomous agent that does online comprehensive research on any given topic
https://gptr.dev
MIT License
12.98k stars 1.61k forks source link

extract_headers() was throwing an exception when it was examining a l… #610

Closed pfrench42 closed 1 week ago

pfrench42 commented 1 week ago

extract_headers() was throwing an exception when it was examining a line which read "hr". This fix ensures only hN lines which have digits are parsed

> /gpt_researcher/master/actions.py(331)extract_headers()
-> level = int(line[2])  # Extract header level
(Pdb) p line
'<hr />'
(Pdb) 
pfrench42 commented 1 week ago

To be clear, there were \<hr> markers in the output which was causing line 331 to throw an exception and abort before research completion.