Share via


ChatCompletionServiceExtensions.GetChatMessageContentAsync Method

Definition

Overloads

GetChatMessageContentAsync(IChatCompletionService, ChatHistory, PromptExecutionSettings, Kernel, CancellationToken)

Get a single chat message content for the chat history and settings provided.

GetChatMessageContentAsync(IChatCompletionService, String, PromptExecutionSettings, Kernel, CancellationToken)

Get a single chat message content for the prompt and settings.

GetChatMessageContentAsync(IChatCompletionService, ChatHistory, PromptExecutionSettings, Kernel, CancellationToken)

Get a single chat message content for the chat history and settings provided.

public static System.Threading.Tasks.Task<Microsoft.SemanticKernel.ChatMessageContent> GetChatMessageContentAsync (this Microsoft.SemanticKernel.ChatCompletion.IChatCompletionService chatCompletionService, Microsoft.SemanticKernel.ChatCompletion.ChatHistory chatHistory, Microsoft.SemanticKernel.PromptExecutionSettings? executionSettings = default, Microsoft.SemanticKernel.Kernel? kernel = default, System.Threading.CancellationToken cancellationToken = default);
static member GetChatMessageContentAsync : Microsoft.SemanticKernel.ChatCompletion.IChatCompletionService * Microsoft.SemanticKernel.ChatCompletion.ChatHistory * Microsoft.SemanticKernel.PromptExecutionSettings * Microsoft.SemanticKernel.Kernel * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.SemanticKernel.ChatMessageContent>
<Extension()>
Public Function GetChatMessageContentAsync (chatCompletionService As IChatCompletionService, chatHistory As ChatHistory, Optional executionSettings As PromptExecutionSettings = Nothing, Optional kernel As Kernel = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of ChatMessageContent)

Parameters

chatCompletionService
IChatCompletionService

The target IChatCompletionService interface to extend.

chatHistory
ChatHistory

The chat history to complete.

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 results generated by the remote model

Applies to

GetChatMessageContentAsync(IChatCompletionService, String, PromptExecutionSettings, Kernel, CancellationToken)

Get a single chat message content for the prompt and settings.

public static System.Threading.Tasks.Task<Microsoft.SemanticKernel.ChatMessageContent> GetChatMessageContentAsync (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 GetChatMessageContentAsync : Microsoft.SemanticKernel.ChatCompletion.IChatCompletionService * string * Microsoft.SemanticKernel.PromptExecutionSettings * Microsoft.SemanticKernel.Kernel * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.SemanticKernel.ChatMessageContent>
<Extension()>
Public Function GetChatMessageContentAsync (chatCompletionService As IChatCompletionService, prompt As String, Optional executionSettings As PromptExecutionSettings = Nothing, Optional kernel As Kernel = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of ChatMessageContent)

Parameters

chatCompletionService
IChatCompletionService

The target IChatCompletionSErvice interface to extend.

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

Single chat message content generated by the remote model.

Applies to