Share via


CopilotStudioAgent Class

Definition

Represents a Copilot Studio agent in the cloud.

public class CopilotStudioAgent : Microsoft.Agents.AI.AIAgent
type CopilotStudioAgent = class
    inherit AIAgent
Public Class CopilotStudioAgent
Inherits AIAgent
Inheritance
CopilotStudioAgent

Constructors

CopilotStudioAgent(CopilotClient, ILoggerFactory)

Initializes a new instance of the CopilotStudioAgent class.

Properties

Client

The client used to interact with the Copilot Agent service.

Description

Gets a description of the agent's purpose, capabilities, or behavior.

(Inherited from AIAgent)
DisplayName

Gets a display-friendly name for the agent.

(Inherited from AIAgent)
Id

Gets the unique identifier for this agent instance.

(Inherited from AIAgent)
Name

Gets the human-readable name of the agent.

(Inherited from AIAgent)

Methods

DeserializeThread(JsonElement, JsonSerializerOptions)

Deserializes an agent thread from its JSON serialized representation.

GetNewThread()

Creates a new conversation thread that is compatible with this agent.

GetNewThread(String)

Get a new AgentThread instance using an existing conversation id, to continue that conversation.

GetService(Type, Object)

Asks the AIAgent for an object of the specified type serviceType.

GetService<TService>(Object)

Asks the AIAgent for an object of type TService.

(Inherited from AIAgent)
RunAsync(AgentThread, AgentRunOptions, CancellationToken)

Run the agent with no message assuming that all required instructions are already provided to the agent or on the thread.

(Inherited from AIAgent)
RunAsync(ChatMessage, AgentThread, AgentRunOptions, CancellationToken)

Runs the agent with a single chat message.

(Inherited from AIAgent)
RunAsync(IEnumerable<ChatMessage>, AgentThread, AgentRunOptions, CancellationToken)

Runs the agent with a collection of chat messages, providing the core invocation logic that all other overloads delegate to.

RunAsync(String, AgentThread, AgentRunOptions, CancellationToken)

Runs the agent with a text message from the user.

(Inherited from AIAgent)
RunStreamingAsync(AgentThread, AgentRunOptions, CancellationToken)

Runs the agent in streaming mode without providing new input messages, relying on existing context and instructions.

(Inherited from AIAgent)
RunStreamingAsync(ChatMessage, AgentThread, AgentRunOptions, CancellationToken)

Runs the agent in streaming mode with a single chat message.

(Inherited from AIAgent)
RunStreamingAsync(IEnumerable<ChatMessage>, AgentThread, AgentRunOptions, CancellationToken)

Runs the agent in streaming mode with a collection of chat messages, providing the core streaming invocation logic.

RunStreamingAsync(String, AgentThread, AgentRunOptions, CancellationToken)

Runs the agent in streaming mode with a text message from the user.

(Inherited from AIAgent)

Extension Methods

AsAIFunction(AIAgent, AIFunctionFactoryOptions, AgentThread)

Creates an AIFunction that runs the provided AIAgent.

AsBuilder(AIAgent)

Creates a new AIAgentBuilder using the specified agent as the foundation for the builder pipeline.

MapA2A(AIAgent, AgentCard, TaskManager, ILoggerFactory)

Attaches A2A (Agent-to-Agent) messaging capabilities via Message processing to the specified AIAgent.

MapA2A(AIAgent, TaskManager, ILoggerFactory)

Attaches A2A (Agent-to-Agent) messaging capabilities via Message processing to the specified AIAgent.

RunAsync(AIAgent, IEnumerable<ChatMessage>, AgentThread, AgentRunOptions, CancellationToken)

Runs the AI agent with a collection of OpenAI chat messages and returns the response as a native OpenAI OpenAI.Chat.ChatCompletion.

RunStreamingAsync(AIAgent, IEnumerable<ChatMessage>, AgentThread, AgentRunOptions, CancellationToken)

Runs the AI agent with a single OpenAI chat message and returns the response as collection of native OpenAI OpenAI.Chat.StreamingChatCompletionUpdate.

Applies to