Skip to content
Docs Try Aspire

HostedAgentResourceBuilderExtensions Methods

Class Methods 7 members
Extension methods for adding hosted agent applications to the distributed application model.
AddAndPublishPromptAgent(IResourceBuilder<AzureCognitiveServicesProjectResource>, IResourceBuilder<FoundryDeploymentResource>, string, string?) Section titled AddAndPublishPromptAgent(IResourceBuilder<AzureCognitiveServicesProjectResource>, IResourceBuilder<FoundryDeploymentResource>, string, string?) extension IResourceBuilder<AzurePromptAgentResource>
Publish a simple prompt agent in Microsoft Foundry. If a project resource is not provided, the method will attempt to find an existing Microsoft Foundry project resource in the application model.
public static class HostedAgentResourceBuilderExtensions
{
public static IResourceBuilder<AzurePromptAgentResource> AddAndPublishPromptAgent(
this IResourceBuilder<AzureCognitiveServicesProjectResource> project,
IResourceBuilder<FoundryDeploymentResource> model,
string name,
string? instructions)
{
// ...
}
}
project IResourceBuilder<AzureCognitiveServicesProjectResource>
model IResourceBuilder<FoundryDeploymentResource>
name string
instructions string?
AsHostedAgent(IResourceBuilder<T>, Action<HostedAgentConfiguration>) Section titled AsHostedAgent(IResourceBuilder<T>, Action<HostedAgentConfiguration>) extension IResourceBuilder<T>
In both run and publish modes, build, deploy, and run the containerized agent as a hosted agent in Microsoft Foundry.
public static class HostedAgentResourceBuilderExtensions
{
public static IResourceBuilder<T> AsHostedAgent<T>(
this IResourceBuilder<T> builder,
Action<HostedAgentConfiguration>? configure = null)
{
// ...
}
}
builder IResourceBuilder<T>
configure Action<HostedAgentConfiguration> optional
This overload is not available in polyglot app hosts because run-mode hosted agents are not yet implemented.
AsHostedAgent(IResourceBuilder<T>, IResourceBuilder<AzureCognitiveServicesProjectResource>, Action<HostedAgentConfiguration>) Section titled AsHostedAgent(IResourceBuilder<T>, IResourceBuilder<AzureCognitiveServicesProjectResource>, Action<HostedAgentConfiguration>) extension IResourceBuilder<T>
In both run and publish modes, build, deploy, and run the containerized agent as a hosted agent in Microsoft Foundry.
public static class HostedAgentResourceBuilderExtensions
{
public static IResourceBuilder<T> AsHostedAgent<T>(
this IResourceBuilder<T> builder,
IResourceBuilder<AzureCognitiveServicesProjectResource>? project = null,
Action<HostedAgentConfiguration>? configure = null)
{
// ...
}
}
builder IResourceBuilder<T>
project IResourceBuilder<AzureCognitiveServicesProjectResource> optional
configure Action<HostedAgentConfiguration> optional
This overload is not available in polyglot app hosts because run-mode hosted agents are not yet implemented.
PublishAsHostedAgent(IResourceBuilder<T>, Action<HostedAgentConfiguration>) Section titled PublishAsHostedAgent(IResourceBuilder<T>, Action<HostedAgentConfiguration>) extension IResourceBuilder<T>
Publish the containerized agent as a hosted agent in Microsoft Foundry. If a project resource is not provided, the method will attempt to find an existing Microsoft Foundry project resource in the application model. If none exists, a new project resource (and its parent account resource) will be created automatically.
public static class HostedAgentResourceBuilderExtensions
{
public static IResourceBuilder<T> PublishAsHostedAgent<T>(
this IResourceBuilder<T> builder,
Action<HostedAgentConfiguration> configure)
{
// ...
}
}
builder IResourceBuilder<T>
configure Action<HostedAgentConfiguration>
PublishAsHostedAgent(IResourceBuilder<T>, IResourceBuilder<AzureCognitiveServicesProjectResource>, Action<HostedAgentConfiguration>) Section titled PublishAsHostedAgent(IResourceBuilder<T>, IResourceBuilder<AzureCognitiveServicesProjectResource>, Action<HostedAgentConfiguration>) extension IResourceBuilder<T>
Publish the containerized agent as a hosted agent in Microsoft Foundry. If a project resource is not provided, the method will attempt to find an existing Microsoft Foundry project resource in the application model. If none exists, a new project resource (and its parent account resource) will be created automatically.
public static class HostedAgentResourceBuilderExtensions
{
public static IResourceBuilder<T> PublishAsHostedAgent<T>(
this IResourceBuilder<T> builder,
IResourceBuilder<AzureCognitiveServicesProjectResource>? project = null,
Action<HostedAgentConfiguration>? configure = null)
{
// ...
}
}
builder IResourceBuilder<T>
project IResourceBuilder<AzureCognitiveServicesProjectResource> optional
configure Action<HostedAgentConfiguration> optional
RunAsHostedAgent(IResourceBuilder<T>, Action<HostedAgentConfiguration>) Section titled RunAsHostedAgent(IResourceBuilder<T>, Action<HostedAgentConfiguration>) extension IResourceBuilder<T>
In run mode, build, deploy, and run the containerized agent as a hosted agent in Microsoft Foundry.
public static class HostedAgentResourceBuilderExtensions
{
public static IResourceBuilder<T> RunAsHostedAgent<T>(
this IResourceBuilder<T> builder,
Action<HostedAgentConfiguration> configure)
{
// ...
}
}
builder IResourceBuilder<T>
configure Action<HostedAgentConfiguration>
This overload is not available in polyglot app hosts because run-mode hosted agents are not yet implemented.
RunAsHostedAgent(IResourceBuilder<T>, IResourceBuilder<AzureCognitiveServicesProjectResource>, Action<HostedAgentConfiguration>) Section titled RunAsHostedAgent(IResourceBuilder<T>, IResourceBuilder<AzureCognitiveServicesProjectResource>, Action<HostedAgentConfiguration>) extension IResourceBuilder<T>
In run mode, build, deploy, and run the containerized agent as a hosted agent in Microsoft Foundry.
public static class HostedAgentResourceBuilderExtensions
{
public static IResourceBuilder<T> RunAsHostedAgent<T>(
this IResourceBuilder<T> builder,
IResourceBuilder<AzureCognitiveServicesProjectResource>? project = null,
Action<HostedAgentConfiguration>? configure = null)
{
// ...
}
}
builder IResourceBuilder<T>
project IResourceBuilder<AzureCognitiveServicesProjectResource> optional
configure Action<HostedAgentConfiguration> optional
This overload is not available in polyglot app hosts because run-mode hosted agents are not yet implemented.