openai-php / client

⚡️ OpenAI PHP is a supercharged community-maintained PHP API client that allows you to interact with OpenAI API.
MIT License
4.75k stars 491 forks source link

Bug in CreateStreamedResponseDelt class when using array_filter #126

Closed AstonChenDev closed 1 year ago

AstonChenDev commented 1 year ago

Hi there,

I've been using the CreateStreamedResponseDelt class, and I've identified what I believe to be a bug. Specifically, when calling the array_filter function within this class, the string "0" is being filtered out, which causes unexpected behavior when calculating certain values.

To reproduce the issue, you can use the following prompt: “whats the result of 100 * 10 ” the StreamResponse should be 1000. However, the returning is 100, which is incorrect and seems related to the aforementioned bug.

I would greatly appreciate it if this issue could be looked into and resolved as soon as possible.

Please let me know if you need more information or if there is anything else I can do to assist in resolving this issue.

Thanks,

pb30 commented 1 year ago

I believe https://github.com/openai-php/client/pull/108 should fix this, but no new version has been tagged

gehrisandro commented 1 year ago

New version has been tag now: https://github.com/openai-php/client/blob/main/CHANGELOG.md#v050-2023-05-24