Skip to content

[Bug]: Unknown Responses streaming event: response.rate_limits.updated #760

@ejellard

Description

@ejellard

Description

I can't reproduce this reliably as it is presumably related to rate-limits, but on the 0.18 branch we had a similar issue where the 'keepalive' event caused problems #732

We're getting the same style of error reports in our logs, 'Unknown Responses streaming event: response.rate_limits.updated'

Steps To Reproduce

Our code is broadly:

$client = OpenAI::client($secret);
$max_tool_rounds = 3;

for ($round = 0; $round <= $max_tool_rounds; $round++) {

    try {
        $stream = $client->responses()->createStreamed($current_params);

        foreach ($stream as $streamed_response) {
               // do stuff
        }

       // do stuff with tools via code similar to:
       //foreach ($response->output as $output) {
            // if ($output instanceof OutputFunctionToolCall) { }
     // }
   } catch (Exception|UnserializableResponse $e) {

   }
}

The error is throwing on the foreach ($stream as $streamed_response) line
[redacted]/vendor/openai-php/client/src/Responses/StreamResponse.php:73
[redacted]OurFile.php getIterator()

OpenAI PHP Client Version

0.19.1

PHP Version

8.3

Notes

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions