CopilotClientExtensions.AsAIAgent 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 |
|---|---|
| AsAIAgent(CopilotClient, SessionConfig, Boolean, String, String, String) |
Retrieves an instance of AIAgent for a GitHub Copilot client. |
| AsAIAgent(CopilotClient, Boolean, String, String, String, IList<AITool>, String) |
Retrieves an instance of AIAgent for a GitHub Copilot client. |
AsAIAgent(CopilotClient, SessionConfig, Boolean, String, String, String)
Retrieves an instance of AIAgent for a GitHub Copilot client.
public static Microsoft.Agents.AI.AIAgent AsAIAgent(this GitHub.Copilot.CopilotClient client, GitHub.Copilot.SessionConfig? sessionConfig = default, bool ownsClient = false, string? id = default, string? name = default, string? description = default);
static member AsAIAgent : GitHub.Copilot.CopilotClient * GitHub.Copilot.SessionConfig * bool * string * string * string -> Microsoft.Agents.AI.AIAgent
<Extension()>
Public Function AsAIAgent (client As CopilotClient, Optional sessionConfig As SessionConfig = Nothing, Optional ownsClient As Boolean = false, Optional id As String = Nothing, Optional name As String = Nothing, Optional description As String = Nothing) As AIAgent
Parameters
- client
- GitHub.Copilot.CopilotClient
The GitHub.Copilot.CopilotClient to use for the agent.
- sessionConfig
- GitHub.Copilot.SessionConfig
Optional session configuration for the agent.
- ownsClient
- Boolean
Whether the agent owns the client and should dispose it. Default is false.
- id
- String
The unique identifier for the agent.
- name
- String
The name of the agent.
- description
- String
The description of the agent.
Returns
An AIAgent instance backed by the GitHub Copilot client.
Applies to
AsAIAgent(CopilotClient, Boolean, String, String, String, IList<AITool>, String)
Retrieves an instance of AIAgent for a GitHub Copilot client.
public static Microsoft.Agents.AI.AIAgent AsAIAgent(this GitHub.Copilot.CopilotClient client, bool ownsClient = false, string? id = default, string? name = default, string? description = default, System.Collections.Generic.IList<Microsoft.Extensions.AI.AITool>? tools = default, string? instructions = default);
static member AsAIAgent : GitHub.Copilot.CopilotClient * bool * string * string * string * System.Collections.Generic.IList<Microsoft.Extensions.AI.AITool> * string -> Microsoft.Agents.AI.AIAgent
<Extension()>
Public Function AsAIAgent (client As CopilotClient, Optional ownsClient As Boolean = false, Optional id As String = Nothing, Optional name As String = Nothing, Optional description As String = Nothing, Optional tools As IList(Of AITool) = Nothing, Optional instructions As String = Nothing) As AIAgent
Parameters
- client
- GitHub.Copilot.CopilotClient
The GitHub.Copilot.CopilotClient to use for the agent.
- ownsClient
- Boolean
Whether the agent owns the client and should dispose it. Default is false.
- id
- String
The unique identifier for the agent.
- name
- String
The name of the agent.
- description
- String
The description of the agent.
- instructions
- String
Optional instructions to append as a system message.
Returns
An AIAgent instance backed by the GitHub Copilot client.