ConversationBuilder.WithUser 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 |
|---|---|
| WithUser(ChannelAccount) |
Associates the specified user with the conversation being built. |
| WithUser(String, String) |
Associates a user with the conversation using the specified user ID and optional user name. |
WithUser(ChannelAccount)
Associates the specified user with the conversation being built.
public Microsoft.Agents.Builder.App.Proactive.ConversationBuilder WithUser(Microsoft.Agents.Core.Models.ChannelAccount user);
member this.WithUser : Microsoft.Agents.Core.Models.ChannelAccount -> Microsoft.Agents.Builder.App.Proactive.ConversationBuilder
Public Function WithUser (user As ChannelAccount) As ConversationBuilder
Parameters
- user
- ChannelAccount
The user to associate with the conversation. Cannot be null, and the user's Id property must not be null or whitespace.
Returns
The current instance of the ConversationBuilder with the user set. Enables method chaining.
Exceptions
Thrown when the ChannelAccount.Id is null, empty, or consists solely of whitespace.
Applies to
WithUser(String, String)
Associates a user with the conversation using the specified user ID and optional user name.
public Microsoft.Agents.Builder.App.Proactive.ConversationBuilder WithUser(string userId, string userName = default);
member this.WithUser : string * string -> Microsoft.Agents.Builder.App.Proactive.ConversationBuilder
Public Function WithUser (userId As String, Optional userName As String = Nothing) As ConversationBuilder
Parameters
- userId
- String
The unique identifier of the user to associate with the conversation. Cannot be null, empty, or consist solely of whitespace.
- userName
- String
The display name of the user. If null, the user will be associated without a display name.
Returns
The current instance of ConversationBuilder with the user information set.
Exceptions
Thrown when the userId is null, empty, or consists solely of whitespace.