AzureAIInferenceChatClient.GetResponseAsync Method

Definition

Sends chat messages and returns the response.

public System.Threading.Tasks.Task<Microsoft.Extensions.AI.ChatResponse> GetResponseAsync(System.Collections.Generic.IList<Microsoft.Extensions.AI.ChatMessage> chatMessages, Microsoft.Extensions.AI.ChatOptions? options = default, System.Threading.CancellationToken cancellationToken = default);
abstract member GetResponseAsync : System.Collections.Generic.IList<Microsoft.Extensions.AI.ChatMessage> * Microsoft.Extensions.AI.ChatOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Extensions.AI.ChatResponse>
override this.GetResponseAsync : System.Collections.Generic.IList<Microsoft.Extensions.AI.ChatMessage> * Microsoft.Extensions.AI.ChatOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Extensions.AI.ChatResponse>
Public Function GetResponseAsync (chatMessages As IList(Of ChatMessage), Optional options As ChatOptions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of ChatResponse)

Parameters

chatMessages
IList<ChatMessage>

The chat content to send.

options
ChatOptions

The chat options to configure the request.

cancellationToken
CancellationToken

The CancellationToken to monitor for cancellation requests. The default is None.

Returns

The response messages generated by the client.

Implements

Applies to