CopilotClient Class
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.
This client is used to connect to the Direct-to-Engine API endpoint for Copilot Studio.
public class CopilotClient : Microsoft.Agents.CopilotStudio.Client.Interfaces.ICopilotClient
type CopilotClient = class
interface ICopilotClient
Public Class CopilotClient
Implements ICopilotClient
- Inheritance
-
CopilotClient
- Implements
Constructors
| Name | Description |
|---|---|
| CopilotClient(ConnectionSettings, IHttpClientFactory, Func<String,Task<String>>, ILogger, String) |
Creates a Direct-to-Engine client for Microsoft Copilot Studio hosted agents. |
| CopilotClient(ConnectionSettings, IHttpClientFactory, ILogger, String) |
Creates a Direct-to-Engine client for Microsoft Copilot Studio hosted bots. |
Fields
| Name | Description |
|---|---|
| Settings |
The connection settings for Copilot Studio. |
Methods
| Name | Description |
|---|---|
| AskQuestionAsync(IActivity, CancellationToken) |
Obsolete.
Sends an activity the remote bot and returns the response as an IAsyncEnumerable of IActivity |
| AskQuestionAsync(String, String, CancellationToken) |
Sends a String question to the remote bot and returns the response as an IAsyncEnumerable of IActivity |
| ExecuteAsync(String, IActivity, CancellationToken) |
Executes an activity within the context of a specific conversation. This method ensures the activity is associated with the provided conversation ID. |
| ScopeFromCloud(PowerPlatformCloud) |
Returns the scope URL needed to connect to Copilot Studio from the Power Platform cloud. |
| ScopeFromSettings(ConnectionSettings) |
Returns the scope URL needed to connect to Copilot Studio from the connection settings. |
| SendActivityAsync(IActivity, CancellationToken) |
Sends an activity to the remote bot and returns the response as an async enumerable stream of activities. |
| StartConversationAsync(Boolean, CancellationToken) |
Used to start a conversation with MCS. |
| StartConversationAsync(StartRequest, CancellationToken) |
Starts a new conversation with the Copilot Studio agent using a custom start request. |
| SubscribeAsync(String, String, CancellationToken) |
Obsolete.
Subscribes to an ongoing conversation to receive updates and activities. This method supports reconnection scenarios by allowing specification of the last received event ID. |