load1n9 / openai

Unofficial Deno wrapper for the Open Ai api
MIT License
73 stars 23 forks source link

Implement streaming API #13

Closed lino-levan closed 1 year ago

lino-levan commented 1 year ago

This uses EventSource, so we'll probably have to use Skye's polyfill until https://github.com/denoland/deno/pull/14730 lands.

daimajia commented 1 year ago

Hi @lino-levan Thanks for your working on this project. About the EventSource, do this https://deno.land/x/eventsource@v0.0.3 project works in api streaming?

update: i get it. we are saying the same thing. Looking forward to supporting streaming api.

ChuckJonas commented 1 year ago

In the meantime, maybe consider removing the "stream" option from the API interface?

Just wasted quite a bit of time thinking my code handling the stream was buggy, when really this library just crashes if you set stream:true in the options...

lino-levan commented 1 year ago

I'll make a PR today. Sorry for the trouble!

daimajia commented 1 year ago

How is the progress?

lino-levan commented 1 year ago

Sorry for the delay, didn't get around to doing it yesterday. PR is open now, waiting on a review from @load1n9 to merge.