I don't have the answer for you, but the OpenAI PHP client obviously does something like this so my first stop would be to check out that package and see how they do it.
Nov 23, 2023
3
Level 1
Listening for stream in API Request
Hello all
I'm kind of stuck and need some help (samples). I have an endpoint in my Laravel app called "stream", which is reachable through APP_URL/api/stream
Another application is sending JSON files to this endpoint but in a streaming POST request.
I now have to capture the incoming data , but I have no clue where to start with streaming. I've tried to inject Request class ( public function readStream(Request $request) ) and read from that , but it's empty.
ANy pointers/help/samples on how to create a listener for this type of API POST request ?
Please or to participate in this conversation.