ChatClientStructuredOutputExtensions.CompleteAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
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
- cancellationToken
- CancellationToken
Returns
Task<ChatCompletion<T>>
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
- cancellationToken
- CancellationToken
Returns
Task<ChatCompletion<T>>
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
- cancellationToken
- CancellationToken
Returns
Task<ChatCompletion<T>>
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
- cancellationToken
- CancellationToken
Returns
Task<ChatCompletion<T>>
Applies to
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.