Proactive.CreateConversationAsync Method

Definition

Creates a new conversation using the specified channel adapter and conversation information.

public System.Threading.Tasks.Task<Microsoft.Agents.Builder.App.Proactive.Conversation> CreateConversationAsync(Microsoft.Agents.Builder.IChannelAdapter adapter, Microsoft.Agents.Builder.App.Proactive.CreateConversationOptions createOptions, Microsoft.Agents.Builder.App.RouteHandler continuationHandler = default, string[] autoSignInHandlers = default, Func<Microsoft.Agents.Core.Models.ConversationReference,Microsoft.Agents.Core.Models.IActivity> continuationActivityFactory = default, System.Threading.CancellationToken cancellationToken = default);
member this.CreateConversationAsync : Microsoft.Agents.Builder.IChannelAdapter * Microsoft.Agents.Builder.App.Proactive.CreateConversationOptions * Microsoft.Agents.Builder.App.RouteHandler * string[] * Func<Microsoft.Agents.Core.Models.ConversationReference, Microsoft.Agents.Core.Models.IActivity> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Agents.Builder.App.Proactive.Conversation>
Public Function CreateConversationAsync (adapter As IChannelAdapter, createOptions As CreateConversationOptions, Optional continuationHandler As RouteHandler = Nothing, Optional autoSignInHandlers As String() = Nothing, Optional continuationActivityFactory As Func(Of ConversationReference, IActivity) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Conversation)

Parameters

adapter
IChannelAdapter

The channel adapter used to create the conversation. Cannot be null.

createOptions
CreateConversationOptions

An object containing the details required to create the conversation, including conversation identity, reference, parameters, and scope. Cannot be null. See CreateConversationOptionsBuilder.

continuationHandler
RouteHandler

If null a ContinueConversation is not performed after the conversation is created.

autoSignInHandlers
String[]

Optional: The list of tokens to get. If a handler requires sign-in, only those that have done that can be returned.

continuationActivityFactory
Func<ConversationReference,IActivity>

Optional. If not supplied, the default activity of type Event and name "CreateConversation" is used.

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 newly created Conversation.

Exceptions

Thrown if the RouteHandler specifies token handlers and not all have been signed into.

Applies to