OpenAISwift icon indicating copy to clipboard operation
OpenAISwift copied to clipboard

[QUESTION] Streaming from OpenAI token by token

Open randomsnowflake opened this issue 1 year ago • 2 comments

Is this possible or planned?

randomsnowflake avatar Mar 08 '23 09:03 randomsnowflake

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.

JosephChing avatar Mar 09 '23 00:03 JosephChing

Thanks for letting me know.

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

randomsnowflake avatar Mar 09 '23 07:03 randomsnowflake

Why was this closed? No plans on implementing this?

arthurgarzajr avatar Mar 17 '23 02:03 arthurgarzajr

Why was this closed? No plans on implementing this?

liudhzhyym avatar Mar 22 '23 14:03 liudhzhyym