Share via


AgentAdministrationClient.CreateAgentVersionAsync Method

Definition

Overloads

CreateAgentVersionAsync(String, ProjectsAgentDefinition, IDictionary<String, String>, String, AgentBlueprintReference, Nullable<AgentDefinitionOptInKeys>, CancellationToken)

Source:
AgentAdministrationClient.cs

Create a new agent version.

public virtual System.Threading.Tasks.Task<System.ClientModel.ClientResult<Azure.AI.Projects.Agents.ProjectsAgentVersion>> CreateAgentVersionAsync(string agentName, Azure.AI.Projects.Agents.ProjectsAgentDefinition definition, System.Collections.Generic.IDictionary<string,string> metadata = default, string description = default, Azure.AI.Projects.Agents.AgentBlueprintReference blueprintReference = default, Azure.AI.Projects.Agents.AgentDefinitionOptInKeys? foundryFeatures = default, System.Threading.CancellationToken cancellationToken = default);
abstract member CreateAgentVersionAsync : string * Azure.AI.Projects.Agents.ProjectsAgentDefinition * System.Collections.Generic.IDictionary<string, string> * string * Azure.AI.Projects.Agents.AgentBlueprintReference * Nullable<Azure.AI.Projects.Agents.AgentDefinitionOptInKeys> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.ClientModel.ClientResult<Azure.AI.Projects.Agents.ProjectsAgentVersion>>
override this.CreateAgentVersionAsync : string * Azure.AI.Projects.Agents.ProjectsAgentDefinition * System.Collections.Generic.IDictionary<string, string> * string * Azure.AI.Projects.Agents.AgentBlueprintReference * Nullable<Azure.AI.Projects.Agents.AgentDefinitionOptInKeys> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.ClientModel.ClientResult<Azure.AI.Projects.Agents.ProjectsAgentVersion>>
Public Overridable Function CreateAgentVersionAsync (agentName As String, definition As ProjectsAgentDefinition, Optional metadata As IDictionary(Of String, String) = Nothing, Optional description As String = Nothing, Optional blueprintReference As AgentBlueprintReference = Nothing, Optional foundryFeatures As Nullable(Of AgentDefinitionOptInKeys) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of ClientResult(Of ProjectsAgentVersion))

Parameters

agentName
String

The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent.

  • Must start and end with alphanumeric characters,
  • Can contain hyphens in the middle
  • Must not exceed 63 characters.
definition
ProjectsAgentDefinition

The agent definition. This can be a workflow, hosted agent, or a simple agent definition.

metadata
IDictionary<String,String>

Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.

description
String

A human-readable description of the agent.

blueprintReference
AgentBlueprintReference

The blueprint reference for the agent.

foundryFeatures
Nullable<AgentDefinitionOptInKeys>

A feature flag opt-in required when using preview operations or modifying persisted preview resources.

cancellationToken
CancellationToken

The cancellation token that can be used to cancel the operation.

Returns

Exceptions

agentName or definition is null.

agentName is an empty string, and was expected to be non-empty.

Service returned a non-success status code.

Applies to

CreateAgentVersionAsync(String, ProjectsAgentVersionCreationOptions, String, CancellationToken)

Source:
AgentAdministrationClient.cs
Source:
AgentAdministrationClient.cs

Create a new agent version.

public virtual System.Threading.Tasks.Task<System.ClientModel.ClientResult<Azure.AI.Projects.Agents.ProjectsAgentVersion>> CreateAgentVersionAsync(string agentName, Azure.AI.Projects.Agents.ProjectsAgentVersionCreationOptions options = default, string foundryFeatures = default, System.Threading.CancellationToken cancellationToken = default);
abstract member CreateAgentVersionAsync : string * Azure.AI.Projects.Agents.ProjectsAgentVersionCreationOptions * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.ClientModel.ClientResult<Azure.AI.Projects.Agents.ProjectsAgentVersion>>
override this.CreateAgentVersionAsync : string * Azure.AI.Projects.Agents.ProjectsAgentVersionCreationOptions * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.ClientModel.ClientResult<Azure.AI.Projects.Agents.ProjectsAgentVersion>>
Public Overridable Function CreateAgentVersionAsync (agentName As String, Optional options As ProjectsAgentVersionCreationOptions = Nothing, Optional foundryFeatures As String = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of ClientResult(Of ProjectsAgentVersion))

Parameters

agentName
String

The name of the agent for which a new version should be created.

options
ProjectsAgentVersionCreationOptions

Options, including the definition, for the new agent version to create.

foundryFeatures
String

Optional experimental features to be used.

cancellationToken
CancellationToken

The cancellation token that can be used to cancel the operation.

Returns

Exceptions

agentName or options is null.

agentName is an empty string, and was expected to be non-empty.

Service returned a non-success status code.

Applies to