Closed
Description
Confirm this is an issue with the Python library and not an underlying OpenAI API
- This is an issue with the Python library
Describe the bug
When I call the openai API, it may be normal for the first 1-6 hours, but then as long as I send a request to gpt-3.5 turbo, an AuthenticationError Invalid token (request id: 20240204142954xxxxxxxxxxxxxxxxxxx) will occur. When I restart my django service, it returns to a normal state, which I am very puzzled about
To Reproduce
- Call the openai interface
- Maintain call frequency and wait for a few hours
- An invalid token with an error occurred
- When restarting django, everything becomes normal again
Code snippets
response = openai.ChatCompletion.create(
model="gpt-3.5-turbo-1106",
stream=True,
messages=conversation_list,
timeout=120
)
for data in response:
if "content" in data["choices"][0]["delta"]:
content = data["choices"][0]["delta"]["content"]
print(content, end='')
OS
linux
Python version
Python v3.9.2
Library version
openai v0.28
Metadata
Metadata
Assignees
Labels
Something isn't workingSomething isn't working