IMcpToolRegistrationService.SendChatHistoryAsync Method

Definition

Overloads

SendChatHistoryAsync(IEnumerable<ChatMessage>, ITurnContext, CancellationToken)

Source:
IMcpToolRegistrationService.cs

Sends chat history to the MCP platform.

public System.Threading.Tasks.Task<Microsoft.Agents.A365.Runtime.OperationResult> SendChatHistoryAsync(System.Collections.Generic.IEnumerable<Microsoft.Extensions.AI.ChatMessage> chatMessages, Microsoft.Agents.Builder.ITurnContext turnContext, System.Threading.CancellationToken cancellationToken = default);
abstract member SendChatHistoryAsync : seq<Microsoft.Extensions.AI.ChatMessage> * Microsoft.Agents.Builder.ITurnContext * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Agents.A365.Runtime.OperationResult>
Public Function SendChatHistoryAsync (chatMessages As IEnumerable(Of ChatMessage), turnContext As ITurnContext, Optional cancellationToken As CancellationToken = Nothing) As Task(Of OperationResult)

Parameters

chatMessages
IEnumerable<ChatMessage>

The chat messages to send. Empty collections are valid and will be forwarded to the MCP platform.

turnContext
ITurnContext

Turn context for the current request.

cancellationToken
CancellationToken

Cancellation token.

Returns

An OperationResult indicating success or failure.

Exceptions

Thrown when chatMessages or turnContext is null.

Remarks

Empty message collections are passed through to the MCP platform rather than being short-circuited. This ensures the platform call is always made, allowing the platform to handle empty states as needed.

Applies to

SendChatHistoryAsync(IEnumerable<ChatMessage>, ITurnContext, ToolOptions, CancellationToken)

Source:
IMcpToolRegistrationService.cs

Sends chat history to the MCP platform.

public System.Threading.Tasks.Task<Microsoft.Agents.A365.Runtime.OperationResult> SendChatHistoryAsync(System.Collections.Generic.IEnumerable<Microsoft.Extensions.AI.ChatMessage> chatMessages, Microsoft.Agents.Builder.ITurnContext turnContext, Microsoft.Agents.A365.Tooling.Models.ToolOptions toolOptions, System.Threading.CancellationToken cancellationToken = default);
abstract member SendChatHistoryAsync : seq<Microsoft.Extensions.AI.ChatMessage> * Microsoft.Agents.Builder.ITurnContext * Microsoft.Agents.A365.Tooling.Models.ToolOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Agents.A365.Runtime.OperationResult>
Public Function SendChatHistoryAsync (chatMessages As IEnumerable(Of ChatMessage), turnContext As ITurnContext, toolOptions As ToolOptions, Optional cancellationToken As CancellationToken = Nothing) As Task(Of OperationResult)

Parameters

chatMessages
IEnumerable<ChatMessage>

The chat messages to send. Empty collections are valid and will be forwarded to the MCP platform.

turnContext
ITurnContext

Turn context for the current request.

toolOptions
ToolOptions

Tool options for configuration.

cancellationToken
CancellationToken

Cancellation token.

Returns

An OperationResult indicating success or failure.

Exceptions

Thrown when chatMessages, turnContext, or toolOptions is null.

Remarks

Empty message collections are passed through to the MCP platform rather than being short-circuited. This ensures the platform call is always made, allowing the platform to handle empty states as needed.

Applies to