Streaming with Azure OpenAI API

Ravi K 70 Reputation points
2023-10-30T18:03:42.1+00:00

Is there a way to stream the output from the Azure OpenAI API so that UI does not have to wait for the entire response?

Thanks,

Ravi.

Azure OpenAI Service
Azure OpenAI Service
An Azure service that provides access to OpenAI’s GPT-3 models with enterprise capabilities.
3,123 questions
0 comments No comments
{count} votes

Accepted answer
  1. Pramod Valavala 20,636 Reputation points Microsoft Employee
    2023-10-30T20:11:11.67+00:00

    @Ravi K Both the completions and chat APIs support a stream parameter, which when set to true, streams the response back from the model via Server Sevent Events (SSE).

    The same is supported in the SDKs available as well. For example, in C#, you can use the GetChatCompletionsStreaming/GetChatCompletionsStreamingAsync methods for chat completions and the GetCompletionsStreaming/GetCompletionsStreamingAsync methods for regular completions.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.