rotemweiss57 / gpt-newspaper

GPT based autonomous agent designed to create personalized newspapers tailored to user preferences.
https://tavily.com
MIT License
1.19k stars 166 forks source link

Article prompts need filtering for special characters that cannot be part of a valid file name #7

Closed ciconsulting closed 10 months ago

ciconsulting commented 10 months ago

"FileNotFoundError: [Errno 2] No such file or directory: 'outputs/run_1706269702/The_US_GDP_Numbers,_opinion_of_Top_Fund_Managers_and/or_Bank_CEO.html'"

It looks like if the article prompt has characters that can't be part of a valid file name the program breaks before completing with an error message similar to the above.

kushalshm1 commented 10 months ago

Can you tell me how to produce this error again?

ciconsulting commented 10 months ago

It looks to me like if you request an article that has a / in teh text. Like "Opinion of XYZ and/or ABC" it creates an invalid filename and the whole thing breaks. "/" needs to be either disallowed in the original request or better filtered out. There may be other special characters that cause the same or similar problem. I am pretty sure that in this case the problem is that "/" is not allowed as a file name.

rotemweiss57 commented 10 months ago

@ciconsulting good catch, I will push a fix soon

rotemweiss57 commented 10 months ago

thank you @sharma-aarushi!