What is a recommended polling interval for Run object to check the status?

Hey everyone,

So, the documentation says, that we should “periodically retrieve the Run object” for updates when we’re dealing with the Assistants API. I wonder, what is a good polling interval (e.g., 1 second)? Also, should I implement a certain timeout in case the status doesn’t change to stop polling? If so what would be a good timeout in seconds? I am probably missing something that the docs already mention. Thanks.

2 Likes

I have been polling every 500ms, and time-out after 15000ms. I don’t think there is a “right” answer. It depends on your use-case. I have found Assistant runs to be extremely slow, e.g. anywhere from 3-15+ seconds. So too short of a polling interval would be useless.

1 Like

I am seeing an issue this morning where the run never gets to completed status for some reason.

Anyone else seeing this too?

@raj5 I think it might depened on the implementation? I’ve published a library that takes care of this today, so you might want to check this out - it’s @tmlc/openai-polling on npm, if you’re using JS