adamrushy / OpenAISwift

This is a wrapper library around the ChatGPT and OpenAI HTTP API
MIT License
1.6k stars 242 forks source link

[QUESTION] Streaming from OpenAI token by token #41

Closed randomsnowflake closed 1 year ago

randomsnowflake commented 1 year ago

Is this possible or planned?

JosephChing commented 1 year ago

It should be possible. https://github.com/adamrushy/OpenAISwift/pull/40 In my pull request, I've added all parameters except for "stream" and "logit_bias". The stream parameter makes it so that tokens are sent as server-sent events. This may require the use of another library such as https://github.com/inaka/EventSource.

randomsnowflake commented 1 year ago

Thanks for letting me know.

Regarding the implementation: See here (line 61) for another lib that does it, without external dependencies.

arthurgarzajr commented 1 year ago

Why was this closed? No plans on implementing this?

liudhzhyym commented 1 year ago

Why was this closed? No plans on implementing this?