Description
When using createStreamed() in an environment using Symfony 6.4 and PHP 8.2.27, the iterator fails with:
Warning: Undefined array key "choices"
in vendor/openai-php/client/src/Responses/Chat/CreateStreamedResponse.php on line 45
This seems to happen even with valid requests, because AFAIK streamed SSE responses also include non-message events (e.g. [DONE], empty lines, or keep-alive comments) that don't contain a choices key.
CreateStreamedResponse::from() unconditionally accesses $attributes['choices'], causing a PHP warning.
Steps To Reproduce
Try to get a streamed response with createStreamed() using a locally running Ollama server with Open-AI compatible endpoints.
OpenAI PHP Client Version
v0.18.0
PHP Version
v8.2.27
Notes
No response