FoundryAgent Constructors
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 |
|---|---|
| FoundryAgent(Uri, AuthenticationTokenProvider, AIProjectClientOptions, IList<AITool>, Func<IChatClient,IChatClient>, IServiceProvider) |
Initializes a new instance of the FoundryAgent class from an agent-specific endpoint. |
| FoundryAgent(Uri, AuthenticationTokenProvider, String, String, AIProjectClientOptions, String, String, IList<AITool>, Func<IChatClient, IChatClient>, ILoggerFactory, IServiceProvider) |
Initializes a new instance of the FoundryAgent class using the direct Responses API path. |
FoundryAgent(Uri, AuthenticationTokenProvider, AIProjectClientOptions, IList<AITool>, Func<IChatClient,IChatClient>, IServiceProvider)
Initializes a new instance of the FoundryAgent class from an agent-specific endpoint.
public FoundryAgent(Uri agentEndpoint, System.ClientModel.AuthenticationTokenProvider credential, Azure.AI.Projects.AIProjectClientOptions? clientOptions = default, System.Collections.Generic.IList<Microsoft.Extensions.AI.AITool>? tools = default, Func<Microsoft.Extensions.AI.IChatClient,Microsoft.Extensions.AI.IChatClient>? clientFactory = default, IServiceProvider? services = default);
new Microsoft.Agents.AI.AzureAI.FoundryAgent : Uri * System.ClientModel.AuthenticationTokenProvider * Azure.AI.Projects.AIProjectClientOptions * System.Collections.Generic.IList<Microsoft.Extensions.AI.AITool> * Func<Microsoft.Extensions.AI.IChatClient, Microsoft.Extensions.AI.IChatClient> * IServiceProvider -> Microsoft.Agents.AI.AzureAI.FoundryAgent
Public Sub New (agentEndpoint As Uri, credential As AuthenticationTokenProvider, Optional clientOptions As AIProjectClientOptions = Nothing, Optional tools As IList(Of AITool) = Nothing, Optional clientFactory As Func(Of IChatClient, IChatClient) = Nothing, Optional services As IServiceProvider = Nothing)
Parameters
- agentEndpoint
- Uri
The agent-specific endpoint URI (must contain the agent name in the path).
- credential
- AuthenticationTokenProvider
The authentication credential.
- clientOptions
- AIProjectClientOptions
Optional configuration options for the AIProjectClient.
- clientFactory
- Func<IChatClient,IChatClient>
Provides a way to customize the creation of the underlying IChatClient.
- services
- IServiceProvider
Optional service provider for resolving dependencies required by AI functions.
Applies to
FoundryAgent(Uri, AuthenticationTokenProvider, String, String, AIProjectClientOptions, String, String, IList<AITool>, Func<IChatClient, IChatClient>, ILoggerFactory, IServiceProvider)
Initializes a new instance of the FoundryAgent class using the direct Responses API path.
public FoundryAgent(Uri projectEndpoint, System.ClientModel.AuthenticationTokenProvider credential, string model, string instructions, Azure.AI.Projects.AIProjectClientOptions? clientOptions = default, string? name = default, string? description = default, System.Collections.Generic.IList<Microsoft.Extensions.AI.AITool>? tools = default, Func<Microsoft.Extensions.AI.IChatClient,Microsoft.Extensions.AI.IChatClient>? clientFactory = default, Microsoft.Extensions.Logging.ILoggerFactory? loggerFactory = default, IServiceProvider? services = default);
new Microsoft.Agents.AI.AzureAI.FoundryAgent : Uri * System.ClientModel.AuthenticationTokenProvider * string * string * Azure.AI.Projects.AIProjectClientOptions * string * string * System.Collections.Generic.IList<Microsoft.Extensions.AI.AITool> * Func<Microsoft.Extensions.AI.IChatClient, Microsoft.Extensions.AI.IChatClient> * Microsoft.Extensions.Logging.ILoggerFactory * IServiceProvider -> Microsoft.Agents.AI.AzureAI.FoundryAgent
Public Sub New (projectEndpoint As Uri, credential As AuthenticationTokenProvider, model As String, instructions As String, Optional clientOptions As AIProjectClientOptions = Nothing, Optional name As String = Nothing, Optional description As String = Nothing, Optional tools As IList(Of AITool) = Nothing, Optional clientFactory As Func(Of IChatClient, IChatClient) = Nothing, Optional loggerFactory As ILoggerFactory = Nothing, Optional services As IServiceProvider = Nothing)
Parameters
- projectEndpoint
- Uri
The Microsoft Foundry project endpoint.
- credential
- AuthenticationTokenProvider
The authentication credential.
- model
- String
The model deployment name.
- instructions
- String
The instructions that guide the agent's behavior.
- clientOptions
- AIProjectClientOptions
Optional configuration options for the AIProjectClient.
- name
- String
Optional name for the agent.
- description
- String
Optional description for the agent.
- clientFactory
- Func<IChatClient,IChatClient>
Provides a way to customize the creation of the underlying IChatClient.
- loggerFactory
- ILoggerFactory
Optional logger factory for creating loggers used by the agent.
- services
- IServiceProvider
Optional service provider for resolving dependencies required by AI functions.