Share via


PersistentAgentThread Class

  • java.lang.Object
    • com.azure.ai.agents.persistent.models.PersistentAgentThread

Implements

public final class PersistentAgentThread
implements JsonSerializable<PersistentAgentThread>

Information about a single thread associated with an agent.

Method Summary

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

Reads an instance of PersistentAgentThread from the JsonReader.

OffsetDateTime getCreatedAt()

Get the createdAt property: The Unix timestamp, in seconds, representing when this object was created.

String getId()

Get the id property: The identifier, which can be referenced in API endpoints.

Map<String,String> getMetadata()

Get the metadata property: A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format.

String getObject()

Get the object property: The object type, which is always 'thread'.

ToolResources getToolResources()

Get the toolResources property: A set of resources that are made available to the agent's tools in this thread.

JsonWriter toJson(JsonWriter jsonWriter)

Methods inherited from java.lang.Object

Method Details

fromJson

public static PersistentAgentThread fromJson(JsonReader jsonReader)

Reads an instance of PersistentAgentThread from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of PersistentAgentThread 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.

getCreatedAt

public OffsetDateTime getCreatedAt()

Get the createdAt property: The Unix timestamp, in seconds, representing when this object was created.

Returns:

the createdAt value.

getId

public String getId()

Get the id property: The identifier, which can be referenced in API endpoints.

Returns:

the id value.

getMetadata

public Map<String,String> getMetadata()

Get the metadata property: A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length.

Returns:

the metadata value.

getObject

public String getObject()

Get the object property: The object type, which is always 'thread'.

Returns:

the object value.

getToolResources

public ToolResources getToolResources()

Get the toolResources property: A set of resources that are made available to the agent's tools in this thread. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs.

Returns:

the toolResources value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

Applies to