chatgpt-python icon indicating copy to clipboard operation
chatgpt-python copied to clipboard

Error: \n

Open collin-rxr2 opened this issue 1 year ago • 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!

collin-rxr2 avatar Dec 17 '22 16:12 collin-rxr2

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

pinnaculum avatar Dec 18 '22 20:12 pinnaculum

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

davghz avatar Dec 18 '22 22:12 davghz

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

SilkePilon avatar Dec 20 '22 12:12 SilkePilon

Same here

jinjamator avatar Dec 20 '22 14:12 jinjamator

Same

DavraYoung avatar Dec 22 '22 20:12 DavraYoung

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

collin-rxr2 avatar Dec 25 '22 15:12 collin-rxr2

same error here

samsap avatar Dec 27 '22 20:12 samsap