ChatCompletionServiceExtensions.GetChatMessageContentsAsync 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.
Get chat multiple chat message content choices for the prompt and settings.
public static System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyList<Microsoft.SemanticKernel.ChatMessageContent>> GetChatMessageContentsAsync (this Microsoft.SemanticKernel.ChatCompletion.IChatCompletionService chatCompletionService, string prompt, Microsoft.SemanticKernel.PromptExecutionSettings? executionSettings = default, Microsoft.SemanticKernel.Kernel? kernel = default, System.Threading.CancellationToken cancellationToken = default);
static member GetChatMessageContentsAsync : Microsoft.SemanticKernel.ChatCompletion.IChatCompletionService * string * Microsoft.SemanticKernel.PromptExecutionSettings * Microsoft.SemanticKernel.Kernel * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyList<Microsoft.SemanticKernel.ChatMessageContent>>
<Extension()>
Public Function GetChatMessageContentsAsync (chatCompletionService As IChatCompletionService, prompt As String, Optional executionSettings As PromptExecutionSettings = Nothing, Optional kernel As Kernel = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of IReadOnlyList(Of ChatMessageContent))
Parameters
- chatCompletionService
- IChatCompletionService
Target chat completion service.
- prompt
- String
The standardized prompt input.
- executionSettings
- PromptExecutionSettings
The AI execution settings (optional).
- kernel
- Kernel
The Kernel containing services, plugins, and other state for use throughout the operation.
- cancellationToken
- CancellationToken
The CancellationToken to monitor for cancellation requests. The default is None.
Returns
List of different chat message content choices generated by the remote model
Remarks
This should be used when the settings request for more than one choice.