assafelovic / gpt-researcher

LLM based autonomous agent that conducts local and web research on any topic and generates a comprehensive report with citations.
https://gptr.dev
Apache License 2.0
14.95k stars 2k forks source link

[Errno 22] Invalid argument #86

Closed Drawwork closed 1 year ago

Drawwork commented 1 year ago

according to your instruction, #40 i updated latest code but still this error exist..

Exception in ASGI application Traceback (most recent call last): File "C:\Python311\Lib\site-packages\uvicorn\protocols\websockets\wsproto_impl.py", line 249, in run_asgi result = await self.app(self.scope, self.receive, self.send) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Python311\Lib\site-packages\uvicorn\middleware\proxy_headers.py", line 78, in call return await self.app(scope, receive, send) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Python311\Lib\site-packages\fastapi\applications.py", line 289, in call await super().call(scope, receive, send) File "C:\Python311\Lib\site-packages\starlette\applications.py", line 122, in call await self.middleware_stack(scope, receive, send) File "C:\Python311\Lib\site-packages\starlette\middleware\errors.py", line 149, in call await self.app(scope, receive, send) File "C:\Python311\Lib\site-packages\starlette\middleware\exceptions.py", line 79, in call raise exc File "C:\Python311\Lib\site-packages\starlette\middleware\exceptions.py", line 68, in call await self.app(scope, receive, sender) File "C:\Python311\Lib\site-packages\fastapi\middleware\asyncexitstack.py", line 20, in call raise e File "C:\Python311\Lib\site-packages\fastapi\middleware\asyncexitstack.py", line 17, in call await self.app(scope, receive, send) File "C:\Python311\Lib\site-packages\starlette\routing.py", line 718, in call await route.handle(scope, receive, send) File "C:\Python311\Lib\site-packages\starlette\routing.py", line 341, in handle await self.app(scope, receive, send) File "C:\Python311\Lib\site-packages\starlette\routing.py", line 82, in app await func(session) File "C:\Python311\Lib\site-packages\fastapi\routing.py", line 324, in app await dependant.call(**values) File "C:\test\gpt-researcher\main.py", line 50, in websocket_endpoint await manager.start_streaming(task, report_type, agent, websocket) File "C:\test\gpt-researcher\agent\run.py", line 38, in start_streaming report, path = await run_agent(task, report_type, agent, websocket) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\test\gpt-researcher\agent\run.py", line 50, in run_agent await assistant.conduct_research() File "C:\test\gpt-researcher\agent\research_agent.py", line 139, in conduct_research research_result = await self.run_search_summary(query) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\test\gpt-researcher\agent\research_agent.py", line 125, in run_search_summary write_to_file(f"./outputs/{self.directory_name}/research-{query}.txt", result) File "C:\test\gpt-researcher\processing\text.py", line 136, in write_to_file with open(filename, "w") as file: ^^^^^^^^^^^^^^^^^^^ OSError: [Errno 22] Invalid argument: './outputs/ai trend within 3months/research-".txt'

assafelovic commented 1 year ago

Great catch! In the meantime, Can you try querying with the following and update if works? -> "ai trends in the last 3 months"