Describe the bug
when calling
openai.ChatCompletion.create( model="gpt-3.5-turbo-0301", messages=[ { "role": "user", "content" : prompt } ], temperature=0.7, max_tokens=MAX_OUTPUT_BASE, n=1)
multiple times in a loop I noticed that the first few attempts run perfectly fine I believe the first 3-5, however after that it fails with the error code openai.error.InvalidRequestError: Invalid URL (POST /v1/chat/completions)
which is very odd as the prior ones are running smoothly within the same exact function call...
I can verify that I'm running on openai==0.27.0 with python 3.9
To Reproduce
-
create an array of texts
2 run the following for text in texts:
MAX_TOKENS = 3500
# used for testing to see how the token limit progrsses over time
response = openai.ChatCompletion.create(
model="gpt-3.5-turbo-0301",
messages=[
{
"role": "user",
"content" : "text"
}
],
temperature=0.7,
max_tokens=MAX_TOKENS, n=1)
Code snippets
No response
OS
macos
Python version
python 3.9
Library version
openai-python v0.27.0