AgentAdministrationClient.CreateSession Method
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.
Creates a new session for an agent endpoint.
The endpoint resolves the backing agent version from version_indicator and
enforces session ownership using the provided isolation key for session-mutating operations.
public virtual System.ClientModel.ClientResult<Azure.AI.Projects.Agents.ProjectAgentSession> CreateSession(string agentName, string isolationKey, Azure.AI.Projects.Agents.VersionIndicator versionIndicator, string agentSessionId = default, System.Threading.CancellationToken cancellationToken = default);
abstract member CreateSession : string * string * Azure.AI.Projects.Agents.VersionIndicator * string * System.Threading.CancellationToken -> System.ClientModel.ClientResult<Azure.AI.Projects.Agents.ProjectAgentSession>
override this.CreateSession : string * string * Azure.AI.Projects.Agents.VersionIndicator * string * System.Threading.CancellationToken -> System.ClientModel.ClientResult<Azure.AI.Projects.Agents.ProjectAgentSession>
Public Overridable Function CreateSession (agentName As String, isolationKey As String, versionIndicator As VersionIndicator, Optional agentSessionId As String = Nothing, Optional cancellationToken As CancellationToken = Nothing) As ClientResult(Of ProjectAgentSession)
Parameters
- agentName
- String
The name of the agent to create a session for.
- isolationKey
- String
Isolation key used by the agent endpoint to enforce session ownership for session-mutating operations.
- versionIndicator
- VersionIndicator
Determines which agent version backs the session.
- agentSessionId
- String
Optional caller-provided session ID. If specified, it must be unique within the agent endpoint. Auto-generated if omitted.
- cancellationToken
- CancellationToken
The cancellation token that can be used to cancel the operation.
Returns
Exceptions
agentName, isolationKey or versionIndicator is null.
agentName or isolationKey is an empty string, and was expected to be non-empty.
Service returned a non-success status code.