#๐Ÿ”’ Chat gpt dont work

28 messages ยท Page 1 of 1 (latest)

long spire
#
import telebot
import openai

openai.api_key = 'key'
#bot = telebot.TeleBot('key')
engine="gpt-3.5-turbo"
prompt = "whats chat gpt"
completion = openai.Completion.create(engine=engine,
                                          prompt=prompt,
                                          temperature=0.5,
                                          max_tokens=1000)
print(completion.choices[0]['text'])

Traceback (most recent call last):
File "C:\Users\Yarik\PycharmProjects\gptbot.venv\bot.py", line 8, in <module>
completion = openai.Completion.create(engine=engine,
File "C:\Users\Yarik\PycharmProjects\gptbot.venv\lib\site-packages\openai\api_resources\completion.py", line 25, in create
return super().create(*args, **kwargs)
File "C:\Users\Yarik\PycharmProjects\gptbot.venv\lib\site-packages\openai\api_resources\abstract\engine_api_resource.py", line 153, in create
response, _, api_key = requestor.request(
File "C:\Users\Yarik\PycharmProjects\gptbot.venv\lib\site-packages\openai\api_requestor.py", line 298, in request
resp, got_stream = self._interpret_response(result, stream)
File "C:\Users\Yarik\PycharmProjects\gptbot.venv\lib\site-packages\openai\api_requestor.py", line 700, in _interpret_response
self._interpret_response_line(
File "C:\Users\Yarik\PycharmProjects\gptbot.venv\lib\site-packages\openai\api_requestor.py", line 765, in _interpret_response_line
raise self.handle_error_response(
openai.error.RateLimitError: You exceeded your current quota, please check your plan and billing details. For more information on this error, read the docs: https://platform.openai.com/docs/guides/error-codes/api-errors.

arctic coralBOT
#

@long spire

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

frail mortar
#

even we can't help since you are being ratelimited

long spire
#

0/18?

frail mortar
#

you will need buy a better subscription plan and if you are using free version then need an active subscription for this code to work

#

since chat gpt api is not free

long spire
#

0 usages

frail mortar
#

you have bought a subscription?

long spire
#

no

frail mortar
#

then that's the issue

#

you need a paid membership for that

#

even if it shows you have tokens available

#

that's just how open ai api works

long spire
#

how can there be no tokens if I donโ€™t use any?

sterile crow
#

have you checked the link in the error message?

sterile crow
#

It's says the solution is to buy credits or increase your limits.

long spire
floral magnet
#

@long spire Potentially an account issue? Contact support.

#

If it were any other type of error you'd be getting a different error message.

sterile crow
#

Maybe you're using the wrong key?

long spire
#

the same

sterile crow
#

Somehow the code looks different in the examples on openai.com.

#
from openai import OpenAI
client = OpenAI(api_key=key)
response = client.chat.completions.create(
    model="gpt-3.5-turbo",
    max_tokens=1000,
    temperature=0.5,
    messages=[
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "whats chat gpt"},
    ]
)
print(response.choices[0]["message"]["content"])```
arctic coralBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.