Code Monkey home page Code Monkey logo

Comments (5)

assafelovic avatar assafelovic commented on August 30, 2024

Hey can you check out the documentation here: https://docs.gptr.dev/docs/gpt-researcher/pip-package

from gpt-researcher.

sonicviz avatar sonicviz commented on August 30, 2024

Yes, I already did that, it's where I got the FastAPI example from.

gpt-researcher is installed correctly, I even reran it to confirm.

Result is the same error.

...
File "E:\Source Control\AI Apps\Python\nextjs-fastapi\.venv\Lib\site-packages\gpt_researcher\master\agent.py", line 77, in conduct_research
[1]     await stream_output("logs", f"\U0001f50e Starting the research task for '{self.query}'...", self.websocket)
[1]   File "E:\Source Control\AI Apps\Python\nextjs-fastapi\.venv\Lib\site-packages\gpt_researcher\master\actions.py", line 321, in stream_output
[1]     print(output)
[1]   File "D:\Python\Lib\encodings\cp1252.py", line 19, in encode
[1]     return codecs.charmap_encode(input,self.errors,encoding_table)[0]
[1]            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[1] UnicodeEncodeError: 'charmap' codec can't encode character '\U0001f50e' in position 0: character maps to <undefined>

from gpt-researcher.

sonicviz avatar sonicviz commented on August 30, 2024

Update:
I noticed in the error above:

File "D:\Python\Lib\encodings\cp1252.py", line 19, in encode
[1]     return codecs.charmap_encode(input,self.errors,encoding_table)[0]

Which is inconsistent with the venv paths.
So I tried a solution from https://stackoverflow.com/questions/18589146/how-to-use-encoding-utf-8-py-instead-of-cp1252-py-in-python ie: Run python with the -X utf8 option.

Instead of running
"python -m uvicorn api.index:app --reload"
run
"python -X utf8 -m uvicorn api.index:app --reload"

and that seems to work.

However, it gets the following ECONNRESET errors periodically during the output in the terminal in VSCode, resulting in an "Internal Server Error" on the FE, though it continues the processing.

[0] Failed to proxy http://127.0.0.1:8000/api/report/What%20is%2042%3F/outline_report Error: socket hang up
[0]     at connResetException (node:internal/errors:720:14)
[0]     at Socket.socketCloseListener (node:_http_client:474:25)
[0]     at Socket.emit (node:events:529:35)
[0]     at TCP.<anonymous> (node:net:350:12)
[0]     at TCP.callbackTrampoline (node:internal/async_hooks:128:17) {
[0]   code: 'ECONNRESET'
[0] }
[0] Error: socket hang up
[0]     at connResetException (node:internal/errors:720:14)
[0]     at Socket.socketCloseListener (node:_http_client:474:25)
[0]     at Socket.emit (node:events:529:35)
[0]     at TCP.<anonymous> (node:net:350:12)
[0]     at TCP.callbackTrampoline (node:internal/async_hooks:128:17) {
[0]   code: 'ECONNRESET'
[0] }

from gpt-researcher.

sonicviz avatar sonicviz commented on August 30, 2024

Going to switch to vue to see if I get rid of the ECONNRESET errors.
Seems to be an issue with nextjs https://www.google.com/search?q=ECONNRESET+fastapi+nextjs

from gpt-researcher.

sonicviz avatar sonicviz commented on August 30, 2024

Ok, switched to Quasar/Vue for the FE and working aok.
Ty, closing this now.

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.