AgentSessionResource Class

  • java.lang.Object
    • com.azure.ai.agents.models.AgentSessionResource

Implements

public final class AgentSessionResource
implements JsonSerializable<AgentSessionResource>

An agent session providing a long-lived compute sandbox for hosted agent invocations.

Method Summary

Modifier and Type Method and Description
static AgentSessionResource fromJson(JsonReader jsonReader)

Reads an instance of AgentSessionResource from the JsonReader.

String getAgentSessionId()

Get the agentSessionId property: The session identifier.

OffsetDateTime getCreatedAt()

Get the createdAt property: The Unix timestamp (in seconds) when the session was created.

OffsetDateTime getExpiresAt()

Get the expiresAt property: The Unix timestamp (in seconds) when the session expires (rolling, 30 days from last activity).

OffsetDateTime getLastAccessedAt()

Get the lastAccessedAt property: The Unix timestamp (in seconds) when the session was last accessed.

AgentSessionStatus getStatus()

Get the status property: The current status of the session.

OffsetDateTime getStoppedAt()

Get the stoppedAt property: The Unix timestamp (in seconds) when the session sandbox was last observed to stop or go idle.

VersionIndicator getVersionIndicator()

Get the versionIndicator property: The version indicator determining which agent version backs this session.

JsonWriter toJson(JsonWriter jsonWriter)

Methods inherited from java.lang.Object

Method Details

fromJson

public static AgentSessionResource fromJson(JsonReader jsonReader)

Reads an instance of AgentSessionResource from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of AgentSessionResource if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.

Throws:

IOException

- If the deserialized JSON object was missing any required properties.

getAgentSessionId

public String getAgentSessionId()

Get the agentSessionId property: The session identifier.

Returns:

the agentSessionId value.

getCreatedAt

public OffsetDateTime getCreatedAt()

Get the createdAt property: The Unix timestamp (in seconds) when the session was created.

Returns:

the createdAt value.

getExpiresAt

public OffsetDateTime getExpiresAt()

Get the expiresAt property: The Unix timestamp (in seconds) when the session expires (rolling, 30 days from last activity).

Returns:

the expiresAt value.

getLastAccessedAt

public OffsetDateTime getLastAccessedAt()

Get the lastAccessedAt property: The Unix timestamp (in seconds) when the session was last accessed.

Returns:

the lastAccessedAt value.

getStatus

public AgentSessionStatus getStatus()

Get the status property: The current status of the session.

Returns:

the status value.

getStoppedAt

public OffsetDateTime getStoppedAt()

Get the stoppedAt property: The Unix timestamp (in seconds) when the session sandbox was last observed to stop or go idle. Present only after the session has gone idle at least once, used for accurate idle-billing reconciliation.

Returns:

the stoppedAt value.

getVersionIndicator

public VersionIndicator getVersionIndicator()

Get the versionIndicator property: The version indicator determining which agent version backs this session.

Returns:

the versionIndicator value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

Applies to