Issue while submitting the tools output

I’m using the openai-php/client.

After I check the “requires_action” status of the run I call the tools, check again the “requires_action” status and then submit tool outputs, something very easy like:

$run = $this->client->threads()->runs()->retrieve($threadId, $runId);
if ($run['status'] == 'requires_action') { 
    $this->client->threads()->runs()->submitToolOutputs($threadId, $runId, ['tool_outputs' => $outputs]);
}

The submitToolOutputs method sometimes throws an Exception Runs in status "queued" do not accept tool outputs. - how is that possibile? I just checked the status.

Does anyone is experiencing the same problem?

1 Like