Skip to content

handle keepalive events #189

@verner-lall

Description

@verner-lall

Hello!

EDIT: It seems this is fixed on openai-php/client openai-php/client#734 so a version bump here would probably help

When using the OpenAI::responses()->createStreamed method, a keepalive event kills the stream.

open ai is sending new "keepalive" events which are not handled by this library and throw an error (CreateStreamedResponse line 117)

It does not seem to be possible to handle catching this error on my end and keeping the stream going.

OpenAI\Exceptions\UnknownEventException Unknown Responses streaming event: keepalive 
    vendor/openai-php/client/src/Responses/Responses/CreateStreamedResponse.php:83 OpenAI\Responses\Responses\CreateStreamedResponse::from
    vendor/openai-php/client/src/Responses/StreamResponse.php:72 OpenAI\Responses\StreamResponse::getIterator

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions