Compartilhar via


IMcpToolRegistrationService.SendChatHistoryAsync Method

Definition

Overloads

Name Description
SendChatHistoryAsync(ChatMessageStore, ITurnContext, CancellationToken)

Sends chat history from a ChatMessageStore to the MCP platform.

SendChatHistoryAsync(IEnumerable<ChatMessage>, ITurnContext, CancellationToken)

Sends chat history to the MCP platform.

SendChatHistoryAsync(ChatMessageStore, ITurnContext, ToolOptions, CancellationToken)

Sends chat history from a ChatMessageStore to the MCP platform.

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

Sends chat history to the MCP platform.

SendChatHistoryAsync(ChatMessageStore, ITurnContext, CancellationToken)

Source:
IMcpToolRegistrationService.cs

Sends chat history from a ChatMessageStore to the MCP platform.

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

Parameters

chatMessageStore
Microsoft.Agents.AI.ChatMessageStore

The chat message store containing the conversation history. Empty stores are valid and will result in an empty array being 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 chatMessageStore or turnContext is null.

Remarks

Empty message stores 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, 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(ChatMessageStore, ITurnContext, ToolOptions, CancellationToken)

Source:
IMcpToolRegistrationService.cs

Sends chat history from a ChatMessageStore to the MCP platform.

public System.Threading.Tasks.Task<Microsoft.Agents.A365.Runtime.OperationResult> SendChatHistoryAsync(Microsoft.Agents.AI.ChatMessageStore chatMessageStore, Microsoft.Agents.Builder.ITurnContext turnContext, Microsoft.Agents.A365.Tooling.Models.ToolOptions toolOptions, System.Threading.CancellationToken cancellationToken = default);
abstract member SendChatHistoryAsync : Microsoft.Agents.AI.ChatMessageStore * 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 (chatMessageStore As ChatMessageStore, turnContext As ITurnContext, toolOptions As ToolOptions, Optional cancellationToken As CancellationToken = Nothing) As Task(Of OperationResult)

Parameters

chatMessageStore
Microsoft.Agents.AI.ChatMessageStore

The chat message store containing the conversation history. Empty stores are valid and will result in an empty array being 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 chatMessageStore, turnContext, or toolOptions is null.

Remarks

Empty message stores 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