softwaremill / sttp-openai

Apache License 2.0
41 stars 9 forks source link

Add ZIO streaming support for chat completions #127

Closed DybekK closed 11 months ago

DybekK commented 11 months ago

This PR adds streaming support for Create chat completion endpoint using ZIO as a streams implementation.

Here are the main changes made in this PR:

package object zio { implicit class extension(val client: OpenAI) { def createStreamedChatCompletion(chatBody: ChatBody): StreamRequest[Either[OpenAIException, Stream[Throwable, ChatChunkResponse]], ZioStreams] } }


- integration tests have been added using HttpClientZioBackend.stub