IMcpToolServerConfigurationService.SendChatHistoryAsync 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.
Overloads
| Name | Description |
|---|---|
| SendChatHistoryAsync(ITurnContext, ChatHistoryMessage[], CancellationToken) |
Sends chat history to the MCP platform for real-time threat protection. |
| SendChatHistoryAsync(ITurnContext, ChatHistoryMessage[], ToolOptions, CancellationToken) |
Sends chat history to the MCP platform for real-time threat protection. |
SendChatHistoryAsync(ITurnContext, ChatHistoryMessage[], CancellationToken)
Sends chat history to the MCP platform for real-time threat protection.
public System.Threading.Tasks.Task<Microsoft.Agents.A365.Runtime.OperationResult> SendChatHistoryAsync(Microsoft.Agents.Builder.ITurnContext turnContext, Microsoft.Agents.A365.Tooling.Models.ChatHistoryMessage[] chatHistoryMessages, System.Threading.CancellationToken cancellationToken = default);
abstract member SendChatHistoryAsync : Microsoft.Agents.Builder.ITurnContext * Microsoft.Agents.A365.Tooling.Models.ChatHistoryMessage[] * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Agents.A365.Runtime.OperationResult>
Public Function SendChatHistoryAsync (turnContext As ITurnContext, chatHistoryMessages As ChatHistoryMessage(), Optional cancellationToken As CancellationToken = Nothing) As Task(Of OperationResult)
Parameters
- turnContext
- ITurnContext
The turn context containing conversation information.
- chatHistoryMessages
- ChatHistoryMessage[]
The chat history messages to send.
- cancellationToken
- CancellationToken
A cancellation token to cancel the operation.
Returns
A task representing the asynchronous operation that returns an OperationResult indicating success or failure.
Exceptions
Thrown when turnContext or chatHistoryMessages is null.
Thrown when required turn context properties (Conversation.Id, Activity.Id, or Activity.Text) are null.
Remarks
HTTP exceptions (HttpRequestException, TaskCanceledException) are caught and logged but not rethrown. Instead, the method returns an OperationResult indicating whether the operation succeeded or failed. Callers can choose to inspect the result for error handling or ignore it if error details are not needed.
Applies to
SendChatHistoryAsync(ITurnContext, ChatHistoryMessage[], ToolOptions, CancellationToken)
Sends chat history to the MCP platform for real-time threat protection.
public System.Threading.Tasks.Task<Microsoft.Agents.A365.Runtime.OperationResult> SendChatHistoryAsync(Microsoft.Agents.Builder.ITurnContext turnContext, Microsoft.Agents.A365.Tooling.Models.ChatHistoryMessage[] chatHistoryMessages, Microsoft.Agents.A365.Tooling.Models.ToolOptions toolOptions, System.Threading.CancellationToken cancellationToken = default);
abstract member SendChatHistoryAsync : Microsoft.Agents.Builder.ITurnContext * Microsoft.Agents.A365.Tooling.Models.ChatHistoryMessage[] * Microsoft.Agents.A365.Tooling.Models.ToolOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Agents.A365.Runtime.OperationResult>
Public Function SendChatHistoryAsync (turnContext As ITurnContext, chatHistoryMessages As ChatHistoryMessage(), toolOptions As ToolOptions, Optional cancellationToken As CancellationToken = Nothing) As Task(Of OperationResult)
Parameters
- turnContext
- ITurnContext
The turn context containing conversation information.
- chatHistoryMessages
- ChatHistoryMessage[]
The chat history messages to send.
- toolOptions
- ToolOptions
Tool options for sending chat history.
- cancellationToken
- CancellationToken
A cancellation token to cancel the operation.
Returns
A task representing the asynchronous operation that returns an OperationResult indicating success or failure.
Exceptions
Thrown when turnContext or chatHistoryMessages is null.
Thrown when required turn context properties (Conversation.Id, Activity.Id, or Activity.Text) are null.
Remarks
HTTP exceptions (HttpRequestException, TaskCanceledException) are caught and logged but not rethrown. Instead, the method returns an OperationResult indicating whether the operation succeeded or failed. Callers can choose to inspect the result for error handling or ignore it if error details are not needed.