labteral/chatgpt-python

Error: \n

collin-rxr2 opened this issue · 7 comments

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!

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

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

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

Same here

Same

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

same error here