Proactive.StoreConversationAsync Method

Definition

Overloads

Name Description
StoreConversationAsync(Conversation, CancellationToken)

Stores the current conversation reference in the proactive storage and returns the conversation identifier.

StoreConversationAsync(ITurnContext, CancellationToken)

Stores the current conversation reference in the proactive storage from the ITurnContext.

StoreConversationAsync(Conversation, CancellationToken)

Stores the current conversation reference in the proactive storage and returns the conversation identifier.

public System.Threading.Tasks.Task<string> StoreConversationAsync(Microsoft.Agents.Builder.App.Proactive.Conversation conversation, System.Threading.CancellationToken cancellationToken = default);
member this.StoreConversationAsync : Microsoft.Agents.Builder.App.Proactive.Conversation * System.Threading.CancellationToken -> System.Threading.Tasks.Task<string>
Public Function StoreConversationAsync (conversation As Conversation, Optional cancellationToken As CancellationToken = Nothing) As Task(Of String)

Parameters

conversation
Conversation

The conversation reference record to store. Cannot be null.

cancellationToken
CancellationToken

A cancellation token that can be used to cancel the asynchronous operation.

Returns

A task that represents the asynchronous operation. The task result contains the ID of the stored conversation.

Applies to

StoreConversationAsync(ITurnContext, CancellationToken)

Stores the current conversation reference in the proactive storage from the ITurnContext.

public System.Threading.Tasks.Task<string> StoreConversationAsync(Microsoft.Agents.Builder.ITurnContext turnContext, System.Threading.CancellationToken cancellationToken = default);
member this.StoreConversationAsync : Microsoft.Agents.Builder.ITurnContext * System.Threading.CancellationToken -> System.Threading.Tasks.Task<string>
Public Function StoreConversationAsync (turnContext As ITurnContext, Optional cancellationToken As CancellationToken = Nothing) As Task(Of String)

Parameters

turnContext
ITurnContext

The context object for the current turn, containing activity and conversation information. Cannot be null.

cancellationToken
CancellationToken

A cancellation token that can be used to cancel the asynchronous operation.

Returns

A string containing the conversation identifier for the stored conversation reference.

Remarks

Use this method to enable proactive messaging scenarios by persisting conversation references. The returned conversation identifier can be used to retrieve or reference the conversation in future operations.

Applies to