Freigeben über


AIProjectAgentsOperations.GetAgentAsync(String, CancellationToken) Method

Definition

Retrieves the agent.

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

Parameters

agentName
String

The name of the agent to retrieve.

cancellationToken
CancellationToken

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

Returns

Exceptions

agentName is null.

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

Service returned a non-success status code.

Applies to