go-openai icon indicating copy to clipboard operation
go-openai copied to clipboard

azure did not support streaming?

Open FunkyYang opened this issue 1 year ago • 2 comments

I use this sdk to connect with azure chat gpt .and set stream true to request.but the result seems a same one createdTime. I wonder why? image

FunkyYang avatar Jun 06 '24 06:06 FunkyYang

streaming seems slowly

FunkyYang avatar Jun 06 '24 08:06 FunkyYang

I don't think this is a bug. The "created" field is the same for each streamed partial result in Azure, but it's also the same when using OpenAI's servers. The API docs describe "created" as:

created
integer

The Unix timestamp (in seconds) of when the chat completion was created.

The multiple parts of a streamed response come from a single chat completion, which is probably why the "created" field is always the same. It's a timestamp of the completion as a whole, not a timestamp of individual streamed parts. This field is created by data from the remote server, not go-openai, so either way this isn't a go-openai bug.

chrbsg avatar Oct 07 '24 10:10 chrbsg