Share via


ChatClientStructuredOutputExtensions.CompleteAsync Method

Definition

Overloads

CompleteAsync<T>(IChatClient, IList<ChatMessage>, ChatOptions, Nullable<Boolean>, CancellationToken)
CompleteAsync<T>(IChatClient, String, ChatOptions, Nullable<Boolean>, CancellationToken)
CompleteAsync<T>(IChatClient, IList<ChatMessage>, JsonSerializerOptions, ChatOptions, Nullable<Boolean>, CancellationToken)
CompleteAsync<T>(IChatClient, String, JsonSerializerOptions, ChatOptions, Nullable<Boolean>, CancellationToken)

CompleteAsync<T>(IChatClient, IList<ChatMessage>, ChatOptions, Nullable<Boolean>, CancellationToken)

public static System.Threading.Tasks.Task<Microsoft.Extensions.AI.ChatCompletion<T>> CompleteAsync<T> (this Microsoft.Extensions.AI.IChatClient chatClient, System.Collections.Generic.IList<Microsoft.Extensions.AI.ChatMessage> chatMessages, Microsoft.Extensions.AI.ChatOptions? options = default, bool? useNativeJsonSchema = default, System.Threading.CancellationToken cancellationToken = default);
static member CompleteAsync : Microsoft.Extensions.AI.IChatClient * System.Collections.Generic.IList<Microsoft.Extensions.AI.ChatMessage> * Microsoft.Extensions.AI.ChatOptions * Nullable<bool> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Extensions.AI.ChatCompletion<'T>>
<Extension()>
Public Function CompleteAsync(Of T) (chatClient As IChatClient, chatMessages As IList(Of ChatMessage), Optional options As ChatOptions = Nothing, Optional useNativeJsonSchema As Nullable(Of Boolean) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of ChatCompletion(Of T))

Type Parameters

T

Parameters

chatClient
IChatClient
chatMessages
IList<ChatMessage>
options
ChatOptions
useNativeJsonSchema
Nullable<Boolean>
cancellationToken
CancellationToken

Returns

Applies to

CompleteAsync<T>(IChatClient, String, ChatOptions, Nullable<Boolean>, CancellationToken)

public static System.Threading.Tasks.Task<Microsoft.Extensions.AI.ChatCompletion<T>> CompleteAsync<T> (this Microsoft.Extensions.AI.IChatClient chatClient, string chatMessage, Microsoft.Extensions.AI.ChatOptions? options = default, bool? useNativeJsonSchema = default, System.Threading.CancellationToken cancellationToken = default);
static member CompleteAsync : Microsoft.Extensions.AI.IChatClient * string * Microsoft.Extensions.AI.ChatOptions * Nullable<bool> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Extensions.AI.ChatCompletion<'T>>
<Extension()>
Public Function CompleteAsync(Of T) (chatClient As IChatClient, chatMessage As String, Optional options As ChatOptions = Nothing, Optional useNativeJsonSchema As Nullable(Of Boolean) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of ChatCompletion(Of T))

Type Parameters

T

Parameters

chatClient
IChatClient
chatMessage
String
options
ChatOptions
useNativeJsonSchema
Nullable<Boolean>
cancellationToken
CancellationToken

Returns

Applies to

CompleteAsync<T>(IChatClient, IList<ChatMessage>, JsonSerializerOptions, ChatOptions, Nullable<Boolean>, CancellationToken)

public static System.Threading.Tasks.Task<Microsoft.Extensions.AI.ChatCompletion<T>> CompleteAsync<T> (this Microsoft.Extensions.AI.IChatClient chatClient, System.Collections.Generic.IList<Microsoft.Extensions.AI.ChatMessage> chatMessages, System.Text.Json.JsonSerializerOptions serializerOptions, Microsoft.Extensions.AI.ChatOptions? options = default, bool? useNativeJsonSchema = default, System.Threading.CancellationToken cancellationToken = default);
static member CompleteAsync : Microsoft.Extensions.AI.IChatClient * System.Collections.Generic.IList<Microsoft.Extensions.AI.ChatMessage> * System.Text.Json.JsonSerializerOptions * Microsoft.Extensions.AI.ChatOptions * Nullable<bool> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Extensions.AI.ChatCompletion<'T>>
<Extension()>
Public Function CompleteAsync(Of T) (chatClient As IChatClient, chatMessages As IList(Of ChatMessage), serializerOptions As JsonSerializerOptions, Optional options As ChatOptions = Nothing, Optional useNativeJsonSchema As Nullable(Of Boolean) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of ChatCompletion(Of T))

Type Parameters

T

Parameters

chatClient
IChatClient
chatMessages
IList<ChatMessage>
serializerOptions
JsonSerializerOptions
options
ChatOptions
useNativeJsonSchema
Nullable<Boolean>
cancellationToken
CancellationToken

Returns

Applies to

CompleteAsync<T>(IChatClient, String, JsonSerializerOptions, ChatOptions, Nullable<Boolean>, CancellationToken)

public static System.Threading.Tasks.Task<Microsoft.Extensions.AI.ChatCompletion<T>> CompleteAsync<T> (this Microsoft.Extensions.AI.IChatClient chatClient, string chatMessage, System.Text.Json.JsonSerializerOptions serializerOptions, Microsoft.Extensions.AI.ChatOptions? options = default, bool? useNativeJsonSchema = default, System.Threading.CancellationToken cancellationToken = default);
static member CompleteAsync : Microsoft.Extensions.AI.IChatClient * string * System.Text.Json.JsonSerializerOptions * Microsoft.Extensions.AI.ChatOptions * Nullable<bool> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Extensions.AI.ChatCompletion<'T>>
<Extension()>
Public Function CompleteAsync(Of T) (chatClient As IChatClient, chatMessage As String, serializerOptions As JsonSerializerOptions, Optional options As ChatOptions = Nothing, Optional useNativeJsonSchema As Nullable(Of Boolean) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of ChatCompletion(Of T))

Type Parameters

T

Parameters

chatClient
IChatClient
chatMessage
String
serializerOptions
JsonSerializerOptions
options
ChatOptions
useNativeJsonSchema
Nullable<Boolean>
cancellationToken
CancellationToken

Returns

Applies to