Condividi tramite


AgentAdministrationClient.GetSessionAsync Method

Definition

Retrieves a session by ID.

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

Parameters

agentName
String

The name of the agent.

sessionId
String

The session identifier.

cancellationToken
CancellationToken

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

Returns

Exceptions

agentName or sessionId is null.

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

Service returned a non-success status code.

Applies to