I am testing the example math tutor code from the docs but the run status is stuck on either queue or in_progress. The same assistant is working in the playground.
from openai import OpenAI
import os
import dotenv
import docx
from time import sleep, ctime
dotenv.load_dotenv()
openai_api_key = os.getenv("OPEN_KEY")
client = OpenAI(api_key=openai_api_key)
assistant = client.beta.assistants.retrieve(assistant_id="MY_ASSISSTANT_ID")
thread = client.beta.threads.create()
message = client.beta.threads.messages.create(
thread_id=thread.id,
role="user",
content="I need to solve the equation `3x + 11 = 14`. Can you help me?"
)
run = client.beta.threads.runs.create(
thread_id=thread.id,
assistant_id=assistant.id,
instructions="Please address the user as Jane Doe. The user has a premium account."
)
run = client.beta.threads.runs.retrieve(
thread_id=thread.id,
run_id=run.id
)
print(client.beta.threads.messages.list(thread_id=thread.id))
print(run)
counter = 0
while run.status != "completed":
print(f"[{ctime()}]: Working... {run.status}")
if counter % 10 == 0:
print(f"\t\t{run}")
counter += 1
sleep(5)
print(client.beta.threads.messages.list(thread_id=thread.id))
The API Reference says the run should almost instantly be moved to in_progress. If this is due to a lot of requests going in shouldnât it fail?
What happened today to the Assistant API, Custom GPTs and OpenAI systems in general? They were very degraded but the report was âall systems operationalâ⌠Do you have a report or something? Would be great.
Iâm still seeing the error, it seems to only happen when I create runs in a Flask app instead of a Jupyter notebook. Hereâs the commands:
message = message_manager.create_message(thread_id=thread['id'], role="user", content=content)#message object is created
run = run_manager.create_run(thread_id=thread['id'], assistant_id='fake_id')#assistant is run on message from user
I run this same code in my Flask app and the status gets stuck in âqueuedâ but running in notebook it completes automatically. Iâm using the same string for the content variable. Thanks in advance for your help:)
Iâm using it with curl in php and have the same problem (I think, not really a coder). But according to my log the last entry is always in_progress.
âstatusâ:âqueuedâ, âŚ
and a second later âstatusâ:âin_progressâ, ⌠nothing after that.
I am also experiencing this issue calling via python. As others have said the playground still works fine. This began for me as I was integrating Functions calls. It looks like all of my previous runs have the âexpiredâ status.
The topic has been pinned globally to enhance its visibility and encourage users to provide specific details when encountering the issue. Rather than âme tooâ responses lacking specifics, the focus is on gathering valuable information. Although the problem has been addressed, there seem to be lingering corner cases.
The pinned status will expire on Thursday. However, if the community can contribute enough specific information, there is hope that the root cause(s) can be identified and resolved. Itâs essential to remember that many employees will be intermittently unavailable over the next few weeks for holidays and vacation time.
Note: I am not an OpenAI employee but a user with the privilege to pin topics.
similar issue - for some reason I cannot fathom, the first run to the thread completes almost instantaneously but a second remains queued forever with no status or usage update, even though the thread shows that an answer was returned.
while run.status == "queued" or run.status == "in_progress":
print(run.status)
run = client.beta.threads.runs.retrieve(
thread_id=thread.id,
run_id=run.id,
)
time.sleep(5)
Here after printing 5/6 times âin_progressâ it is getting stuck there only without returning any error or any movement of the code.
But in the GUI of thread, it can be seen that the correct response is being generated.