labteral / chatgpt-python

Unofficial Python SDK for OpenAI's ChatGPT
https://labteral.github.io/chatgpt-python/
GNU General Public License v3.0
523 stars 76 forks source link

Error: \n #23

Open collin-rxr2 opened 1 year ago

collin-rxr2 commented 1 year ago

Hey, I am trying to ask ChatGPT something but I get an Error everytime.

My Code is:

from chatgpt import Conversation

convo = Conversation(access_token="INSERT API TOKEN HERE")

print("> Design a a Blog in HTML")
try:
    print(convo.chat("Design a Blog in HTML"))
except Exception as error:
    message = error.message
    code = error.code
    print(f"Error Code {code} \nMessage: \n{error.message}")

(btw I put an API Token from https://beta.openai.com/account/api-keys there)

And my Output is

Error Code ChatgptErrorCodes.UNKNOWN_ERROR 
Message:
\n

I dont really get why the Error Message is "\n" and if I run it without the try/except statement, I get following Error.

> Design a a Blog in HTML
Traceback (most recent call last):
  File "c:\Users\Collin\OneDrive\Desktop\chatgpt-bot\main.py", line 6, in <module>
    print(convo.chat("Design a Blog in HTML"))
  File "C:\Users\Collin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\chatgpt\chatgpt.py", line 420, in chat
    raise ChatgptError(
chatgpt.errors.ChatgptError: \n

Any help would be appreciated!

pinnaculum commented 1 year ago

I get the exact same error, token isn't the issue.

davghz commented 1 year ago

I have the same error. Been trying to see how to fix it all day smh.

SilkePilon commented 1 year ago
Traceback (most recent call last):
  File "test.py", line 11, in <module>
    print(conversation.chat("What's the color of the sky?"))
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\****\AppData\Local\Programs\Python\Python311\Lib\site-packages\chatgpt\chatgpt.py", line 420, in chat
    raise ChatgptError(
chatgpt.errors.ChatgptError: \n

also got the same error

jinjamator commented 1 year ago

Same here

DavraYoung commented 1 year ago

Same

collin-rxr2 commented 1 year ago

Can they maybe fix the Library instead of making a Documentation for a Library that doesn't work?

samsap commented 1 year ago

same error here