import openai
# Replace YOUR_API_KEY with your OpenAI API key
openai.api_key = "API-TOKEN"
model_engine = 'text-davinci-003'
prompt= 'Наиши , Привет мир!'
completion = openai.Completion.create(
engine=model_engine,
prompt=prompt,
max_tokens=1024,
n=1,
stop=None,
temperature=0.5,
)
response =completion.choices[0].text
print(response)
А вот ошибка :
Traceback (most recent call last):
File "C:\Users\USERNAME\Desktop\Новая папка (3)\GG.py", line 11, in <module>
completion = openai.Completion.create(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\USERNAME\AppData\Local\Programs\Python\Python311\Lib\site-packages\openai\api_resources\completion.py", line 25, in create
return super().create(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\USERNAME\AppData\Local\Programs\Python\Python311\Lib\site-packages\openai\api_resources\abstract\engine_api_resource.py", line 153, in create
response, _, api_key = requestor.request(
^^^^^^^^^^^^^^^^^^
File "C:\Users\USERNAME\AppData\Local\Programs\Python\Python311\Lib\site-packages\openai\api_requestor.py", line 298, in request
resp, got_stream = self._interpret_response(result, stream)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\USERNAME\AppData\Local\Programs\Python\Python311\Lib\site-packages\openai\api_requestor.py", line 700, in _interpret_response
self._interpret_response_line(
File "C:\Users\USERNAME\AppData\Local\Programs\Python\Python311\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.
Process finished with exit code 1
Код взял из видео чела у которого все заработало