When I try to make a query, it says the error in the title. Here is my code:
from pyChatGPT import ChatGPT # Import ChatGPT API
# Variables
questions = []
answers = []
sessiontoken = I can't say that ;)
# Start the api
api = ChatGPT(sessiontoken)
# Read questions
with open("./questions.txt", "r") as f: questions += f.readlines()
# Send query to api
for q in questions: response = api.send_message(q) ; answers.append(response["message"])
# Clean up answers list
answers = [a[:-1] for a in answers]
# Write answers to file
with open("./answers.txt", "w") as f: f.write(''.join(answers))
# Close chrome window
api.clear_conversations()
api.driver.close()
And here is the whole error:
Traceback (most recent call last):
File "c:\Users\Ender\Dev\OpenAiAPITest\main.py", line 15, in <module>
for q in questions: response = api.send_message(q) ; answers.append(response["message"])
Traceback (most recent call last):
File "c:\Users\Ender\Dev\OpenAiAPITest\main.py", line 15, in <module>
for q in questions: response = api.send_message(q) ; answers.append(response["message"])
^^^^^^^^^^^^^^^^^^^
File "C:\Users\Ender\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyChatGPT\pyChatGPT.py", line 441, in send_message
raise ValueError(response.text)
ValueError: Only one message at a time. Please allow any other responses to complete before sending another message, or wait one minute.
When I try to make a query, it says the error in the title. Here is my code:
And here is the whole error: