terry3041 / pyChatGPT

An unofficial Python wrapper for OpenAI's ChatGPT API
GNU General Public License v3.0
1.35k stars 252 forks source link

ValueError: Too many requests in 1 hour. Try again later. #72

Open Ashi-exp opened 1 year ago

Ashi-exp commented 1 year ago

This error always comes up after getting one successful response from the API request, that is, from the second request onwards. Is there a way to run the code for multiple requests?

terry3041 commented 1 year ago

That's most likely the problem of your ChatGPT account.

Ashi-exp commented 1 year ago

That's most likely the problem of your ChatGPT account.

How can I resolve this?

Nkomol commented 1 year ago

I have the same problem,But I have no problem using the normally opened chrome browser

NachoGarciaBajo commented 1 year ago

I have exactly the same problem

I have tried with different accounts but none works after the second attempt

I'm running it in Google Colab. This is my code:

from pyChatGPT import ChatGPT
import time

session_token = ""
chat_GPT_api = ChatGPT(session_token)

list_of_prompts = [a,b,c]
list_answers = []

for prompt in list_of_prompts:

  time.sleep(10)
  response = chat_GPT_api.send_message(prompt)

  #reset to start a new conversation
  chat_GPT_api.reset_conversation() 

  list_answers.append(response["message"])

And this is the error that I get


WARNING:urllib3.connectionpool:Connection pool is full, discarding connection: localhost. Connection pool size: 1
WARNING:urllib3.connectionpool:Connection pool is full, discarding connection: localhost. Connection pool size: 1
WARNING:urllib3.connectionpool:Connection pool is full, discarding connection: localhost. Connection pool size: 1
WARNING:urllib3.connectionpool:Connection pool is full, discarding connection: localhost. Connection pool size: 1
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
[<ipython-input-35-dc4f2d8c4813>](https://localhost:8080/#) in <module>
     53 
     54   time.sleep(10)
---> 55   response = chat_GPT_api.send_message(prompt)
     56 
     57   #reset to start a new conversation

[/usr/local/lib/python3.8/dist-packages/pyChatGPT/pyChatGPT.py](https://localhost:8080/#) in send_message(self, message)
    614             if 'text-red' in response.get_attribute('class'):
    615                 self.__verbose_print('[send_msg] Response is an error')
--> 616                 raise ValueError(response.text)
    617 
    618         response = self.driver.find_elements(

ValueError: Too many requests in 1 hour. Try again later.

The first 2 warnings happen when initializating the API

The second 2 warning correpond to 2 requests that I send to the api in the for loop. Before it gives an answer in the second one, it breaks because "Too many requests in 1 hour. Try again later"

Nkomol commented 1 year ago

I tried other methods. The current conclusion is that IP is not a problem in the United States