irudnyts / openai

An R package-wrapper around OpenAI API
https://irudnyts.github.io/openai/
Other
164 stars 28 forks source link

Implemented streaming for create_chat_completion #50

Open can-taslicukur opened 11 months ago

can-taslicukur commented 11 months ago

Closes #48

This PR introduces the implementation of streaming for create_chat_completion and also adds an example of how to use it in a Shiny application. It can be implemented similarly for all endpoints with a stream argument.

Also, I am not sure if we should or the best way to parse the response before applying the stream_function. So I am open to suggestions :)