openai-php / client

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

[Enhancement] streaming support for assistant api #357

Closed mgalinskiSaticon closed 1 month ago

mgalinskiSaticon commented 3 months ago

As opposed in the following Q&A, OpenAI has published the support for Message Streaming for the Assistant API, which has been documented. As such I want to open an issue for it.

Q&A Message: Originally posted by @eng-ahmad-sameer in https://github.com/openai-php/client/discussions/351

OpenAI Assistant Streaming Documentation https://platform.openai.com/docs/api-reference/assistants-streaming

slaven-ii commented 3 months ago

I was thinking of opening the same thing and was looking at the other completion stream implementations to try and implement myself but didn't make much progress. Would love this feature to be added

olPdy commented 3 months ago

Need this feature for my project too. I'm looking forward to it

gerdemann commented 3 months ago

Is anyone already working on the feature? Is there anything I can do to help?

EthanBarlo commented 3 months ago

Just created a PR for this, It maps each event onto the correct object classes. So you can loop through the stream and perform whichever actions you want at each event.

Im fairly sure its feature complete, but let me know if anything might be missing from it. Its working fine on my project so far.

CaptainHilly commented 2 months ago

+1 for streaming assistant support pretty, pretty please.

sarathisahoo-muffins commented 1 month ago

Any updates on it. We are blocked due to not having this feature.

Thanks, Sarathi

gehrisandro commented 1 month ago

Implemented in the latest release: https://github.com/openai-php/client/releases/tag/v0.9.0