Code Monkey home page Code Monkey logo

Comments (8)

gH2AX avatar gH2AX commented on June 27, 2024 1

And the issue resurfaced. Let me share the traceback with you:

ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "/opt/homebrew/Caskroom/miniforge/base/envs/gpt-researcher/lib/python3.10/site-packages/uvicorn/protocols/websockets/wsproto_impl.py", line 234, in run_asgi
    result = await self.app(self.scope, self.receive, self.send)
  File "/opt/homebrew/Caskroom/miniforge/base/envs/gpt-researcher/lib/python3.10/site-packages/uvicorn/middleware/proxy_headers.py", line 84, in __call__
    return await self.app(scope, receive, send)
  File "/opt/homebrew/Caskroom/miniforge/base/envs/gpt-researcher/lib/python3.10/site-packages/fastapi/applications.py", line 289, in __call__
    await super().__call__(scope, receive, send)
  File "/opt/homebrew/Caskroom/miniforge/base/envs/gpt-researcher/lib/python3.10/site-packages/starlette/applications.py", line 122, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/opt/homebrew/Caskroom/miniforge/base/envs/gpt-researcher/lib/python3.10/site-packages/starlette/middleware/errors.py", line 149, in __call__
    await self.app(scope, receive, send)
  File "/opt/homebrew/Caskroom/miniforge/base/envs/gpt-researcher/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 79, in __call__
    raise exc
  File "/opt/homebrew/Caskroom/miniforge/base/envs/gpt-researcher/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 68, in __call__
    await self.app(scope, receive, sender)
  File "/opt/homebrew/Caskroom/miniforge/base/envs/gpt-researcher/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 20, in __call__
    raise e
  File "/opt/homebrew/Caskroom/miniforge/base/envs/gpt-researcher/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 17, in __call__
    await self.app(scope, receive, send)
  File "/opt/homebrew/Caskroom/miniforge/base/envs/gpt-researcher/lib/python3.10/site-packages/starlette/routing.py", line 718, in __call__
    await route.handle(scope, receive, send)
  File "/opt/homebrew/Caskroom/miniforge/base/envs/gpt-researcher/lib/python3.10/site-packages/starlette/routing.py", line 341, in handle
    await self.app(scope, receive, send)
  File "/opt/homebrew/Caskroom/miniforge/base/envs/gpt-researcher/lib/python3.10/site-packages/starlette/routing.py", line 82, in app
    await func(session)
  File "/opt/homebrew/Caskroom/miniforge/base/envs/gpt-researcher/lib/python3.10/site-packages/fastapi/routing.py", line 324, in app
    await dependant.call(**values)
  File "/Users/gH2AX/gpt-researcher/main.py", line 50, in websocket_endpoint
    await manager.start_streaming(task, report_type, agent, websocket)
  File "/Users/gH2AX/gpt-researcher/agent/run.py", line 38, in start_streaming
    report, path = await run_agent(task, report_type, agent, websocket)
  File "/Users/gH2AX/gpt-researcher/agent/run.py", line 50, in run_agent
    await assistant.conduct_research()
  File "/Users/gH2AX/gpt-researcher/agent/research_agent.py", line 137, in conduct_research
    search_queries = await self.create_search_queries()
  File "/Users/gH2AX/gpt-researcher/agent/research_agent.py", line 92, in create_search_queries
    return json.loads(result)
  File "/opt/homebrew/Caskroom/miniforge/base/envs/gpt-researcher/lib/python3.10/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/opt/homebrew/Caskroom/miniforge/base/envs/gpt-researcher/lib/python3.10/json/decoder.py", line 340, in decode
    raise JSONDecodeError("Extra data", s, end)
json.decoder.JSONDecodeError: Extra data: line 2 column 1 (char 51)

from gpt-researcher.

darrenmarshall avatar darrenmarshall commented on June 27, 2024 1

the same problem. plz share it for me after you fix it

temporary solution: research_agent.py line 92: return json.loads(result) if type(result) != str else result.strip("[]").replace('"', '').split("] [")

image

Unfortunately adding this line in the latest build didn't correct the issue for me.

from gpt-researcher.

gH2AX avatar gH2AX commented on June 27, 2024

Found the culprit. I happened in the following commit: f4d8beb. Just revert it.

from gpt-researcher.

Drawwork avatar Drawwork commented on June 27, 2024

the same problem. plz share it for me after you fix it

from gpt-researcher.

polygonfuture avatar polygonfuture commented on June 27, 2024

Worked two times and then this starting occuring for me as well using docker container.

from gpt-researcher.

rotemweiss57 avatar rotemweiss57 commented on June 27, 2024

Thank you, will take a look at it. I will update you soon

from gpt-researcher.

paradoxtown avatar paradoxtown commented on June 27, 2024

the same problem. plz share it for me after you fix it

temporary solution:
research_agent.py line 92:
return json.loads(result) if type(result) != str else result.strip("[]").replace('"', '').split("] [")

image

from gpt-researcher.

paradoxtown avatar paradoxtown commented on June 27, 2024

the same problem. plz share it for me after you fix it

temporary solution: research_agent.py line 92: return json.loads(result) if type(result) != str else result.strip("[]").replace('"', '').split("] [")
image

Unfortunately adding this line in the latest build didn't correct the issue for me.

This is because the response from chatgpt cannot follow the format strictly. Most error cases can be solved by the above temporary solution. And I am waiting for the official solution as well.

from gpt-researcher.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.