ChatCompletionAgent.InvokeAsync 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.
Invokes the agent to process the given messages and generate a response.
public System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyList<Microsoft.SemanticKernel.ChatMessageContent>> InvokeAsync (System.Collections.Generic.IReadOnlyList<Microsoft.SemanticKernel.ChatMessageContent> messages, System.Threading.CancellationToken cancellationToken = default);
member this.InvokeAsync : System.Collections.Generic.IReadOnlyList<Microsoft.SemanticKernel.ChatMessageContent> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyList<Microsoft.SemanticKernel.ChatMessageContent>>
Public Function InvokeAsync (messages As IReadOnlyList(Of ChatMessageContent), Optional cancellationToken As CancellationToken = Nothing) As Task(Of IReadOnlyList(Of ChatMessageContent))
Parameters
- messages
- IReadOnlyList<ChatMessageContent>
A list of the messages for the agent to process.
- cancellationToken
- CancellationToken
An optional CancellationToken to cancel the operation.
Returns
List of messages representing the agent's response.