GabrielAgrela / OSROKBOT

Multi-feature bot for Rise of Kingdoms
37 stars 13 forks source link

chatgpt openai.RateLimitError: Error code: 429 #20

Open becauseimnoob opened 9 months ago

becauseimnoob commented 9 months ago

I took the midterm every Sunday to discover your bot. It keeps giving me an error after the first question.

python .\UI.py
Your UI Instance
Window not found

Press k to for the next question

Many well-known figures fought in the Third Crusade. Which of these leaders diedduring this crusade?

Frederick Barbarossa

Richard the Lionheart

Philip Augustus

Saladin
C:\Users\BecauseIm\Desktop\OSROK\venv\Lib\site-packages\sklearn\feature_extraction\text.py:525: UserWarning: The parameter 'token_pattern' will not be used since 'tokenizer' is not None'
  warnings.warn(
Most similar entry 'In which century did the classic English dessert sticky toffee pudding originate?' has a similarity score of: 0.9278 with
Most similar entry 'Richard the Lionheart' has a similarity score of: 0.8280 with

B is the closest match
with : 0.9278481051701406

I couldn't find the answer in the database, trying with CGPT

Exception in thread Thread-2 (run_single_machine):
Traceback (most recent call last):
  File "C:\Users\BecauseIm\AppData\Local\Programs\Python\Python312\Lib\threading.py", line 1073, in _bootstrap_inner
    self.run()
  File "C:\Users\BecauseIm\AppData\Local\Programs\Python\Python312\Lib\threading.py", line 1010, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Users\BecauseIm\Desktop\OSROK\OS_ROKBOT.py", line 29, in run_single_machine
    if machine.execute():
       ^^^^^^^^^^^^^^^^^
  File "C:\Users\BecauseIm\Desktop\OSROK\state_machine.py", line 20, in execute
    result = state.perform()
             ^^^^^^^^^^^^^^^
  File "C:\Users\BecauseIm\Desktop\OSROK\Actions\action.py", line 38, in perform
    result = self.execute()
             ^^^^^^^^^^^^^^
  File "C:\Users\BecauseIm\Desktop\OSROK\Actions\chatgpt_action.py", line 62, in execute
    chat = openai.chat.completions.create(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\BecauseIm\Desktop\OSROK\venv\Lib\site-packages\openai\_utils\_utils.py", line 272, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\BecauseIm\Desktop\OSROK\venv\Lib\site-packages\openai\resources\chat\completions.py", line 645, in create
    return self._post(
           ^^^^^^^^^^^
  File "C:\Users\BecauseIm\Desktop\OSROK\venv\Lib\site-packages\openai\_base_client.py", line 1088, in post
    return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\BecauseIm\Desktop\OSROK\venv\Lib\site-packages\openai\_base_client.py", line 853, in request
    return self._request(
           ^^^^^^^^^^^^^^
  File "C:\Users\BecauseIm\Desktop\OSROK\venv\Lib\site-packages\openai\_base_client.py", line 916, in _request
    return self._retry_request(
           ^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\BecauseIm\Desktop\OSROK\venv\Lib\site-packages\openai\_base_client.py", line 958, in _retry_request
    return self._request(
           ^^^^^^^^^^^^^^
  File "C:\Users\BecauseIm\Desktop\OSROK\venv\Lib\site-packages\openai\_base_client.py", line 916, in _request
    return self._retry_request(
           ^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\BecauseIm\Desktop\OSROK\venv\Lib\site-packages\openai\_base_client.py", line 958, in _retry_request
    return self._request(
           ^^^^^^^^^^^^^^
  File "C:\Users\BecauseIm\Desktop\OSROK\venv\Lib\site-packages\openai\_base_client.py", line 930, in _request
    raise self._make_status_error_from_response(err.response) from None
openai.RateLimitError: Error code: 429 - {'error': {'message': '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.', 'type': 'insufficient_quota', 'param': None, 'code': 'insufficient_quota'}}

Press k to for the next question

What's does the "Skillful Craftsman” alliance skill do when used?

Greatly reduces consi Exam, data «costs for alliance members

Greatly reduces the resource co:of constructing alliance flags

Greatly increases building speedfor alliance members
0

Greatly increases alliance flagconstruction speed
Most similar entry 'Whats does the Skillful Craftsman alliance skill do when used?' has a similarity score of: 0.8890 with
Most similar entry 'Greatly increases alliance flagconstruction speed' has a similarity score of: 0.9976 with

D is the closest match
with : 0.8889939306598574

I couldn't find the answer in the database, trying with CGPT

Exception in thread Thread-28 (run_single_machine):
Traceback (most recent call last):
  File "C:\Users\BecauseIm\AppData\Local\Programs\Python\Python312\Lib\threading.py", line 1073, in _bootstrap_inner
    self.run()
  File "C:\Users\BecauseIm\AppData\Local\Programs\Python\Python312\Lib\threading.py", line 1010, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Users\BecauseIm\Desktop\OSROK\OS_ROKBOT.py", line 29, in run_single_machine
    if machine.execute():
       ^^^^^^^^^^^^^^^^^
  File "C:\Users\BecauseIm\Desktop\OSROK\state_machine.py", line 20, in execute
    result = state.perform()
             ^^^^^^^^^^^^^^^
  File "C:\Users\BecauseIm\Desktop\OSROK\Actions\action.py", line 38, in perform
    result = self.execute()
             ^^^^^^^^^^^^^^
  File "C:\Users\BecauseIm\Desktop\OSROK\Actions\chatgpt_action.py", line 62, in execute
    chat = openai.chat.completions.create(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\BecauseIm\Desktop\OSROK\venv\Lib\site-packages\openai\_utils\_utils.py", line 272, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\BecauseIm\Desktop\OSROK\venv\Lib\site-packages\openai\resources\chat\completions.py", line 645, in create
    return self._post(
           ^^^^^^^^^^^
  File "C:\Users\BecauseIm\Desktop\OSROK\venv\Lib\site-packages\openai\_base_client.py", line 1088, in post
    return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\BecauseIm\Desktop\OSROK\venv\Lib\site-packages\openai\_base_client.py", line 853, in request
    return self._request(
           ^^^^^^^^^^^^^^
  File "C:\Users\BecauseIm\Desktop\OSROK\venv\Lib\site-packages\openai\_base_client.py", line 916, in _request
    return self._retry_request(
           ^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\BecauseIm\Desktop\OSROK\venv\Lib\site-packages\openai\_base_client.py", line 958, in _retry_request
    return self._request(
           ^^^^^^^^^^^^^^
  File "C:\Users\BecauseIm\Desktop\OSROK\venv\Lib\site-packages\openai\_base_client.py", line 916, in _request
    return self._retry_request(
           ^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\BecauseIm\Desktop\OSROK\venv\Lib\site-packages\openai\_base_client.py", line 958, in _retry_request
    return self._request(
           ^^^^^^^^^^^^^^
  File "C:\Users\BecauseIm\Desktop\OSROK\venv\Lib\site-packages\openai\_base_client.py", line 930, in _request
    raise self._make_status_error_from_response(err.response) from None
openai.RateLimitError: Error code: 429 - {'error': {'message': '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.', 'type': 'insufficient_quota', 'param': None, 'code': 'insufficient_quota'}}