Share via


OpenAIClient.GetChatCompletionsStreaming Method

Definition

Begin a chat completions request and get an object that can stream response data as it becomes available.

public virtual Azure.AI.OpenAI.StreamingResponse<Azure.AI.OpenAI.StreamingChatCompletionsUpdate> GetChatCompletionsStreaming (Azure.AI.OpenAI.ChatCompletionsOptions chatCompletionsOptions, System.Threading.CancellationToken cancellationToken = default);
abstract member GetChatCompletionsStreaming : Azure.AI.OpenAI.ChatCompletionsOptions * System.Threading.CancellationToken -> Azure.AI.OpenAI.StreamingResponse<Azure.AI.OpenAI.StreamingChatCompletionsUpdate>
override this.GetChatCompletionsStreaming : Azure.AI.OpenAI.ChatCompletionsOptions * System.Threading.CancellationToken -> Azure.AI.OpenAI.StreamingResponse<Azure.AI.OpenAI.StreamingChatCompletionsUpdate>
Public Overridable Function GetChatCompletionsStreaming (chatCompletionsOptions As ChatCompletionsOptions, Optional cancellationToken As CancellationToken = Nothing) As StreamingResponse(Of StreamingChatCompletionsUpdate)

Parameters

chatCompletionsOptions
ChatCompletionsOptions

the chat completions options for this chat completions request.

cancellationToken
CancellationToken

a cancellation token that can be used to cancel the initial request or ongoing streaming operation.

Returns

The response returned from the service.

Exceptions

chatCompletionsOptions or chatCompletionsOptions.DeploymentName.DeploymentName is null.

chatCompletionsOptions.DeploymentName.DeploymentName is an empty string.

Applies to