Class AssistantThread

java.lang.Object
com.azure.ai.openai.assistants.models.AssistantThread
All Implemented Interfaces:
com.azure.json.JsonSerializable<AssistantThread>

public final class AssistantThread extends Object implements com.azure.json.JsonSerializable<AssistantThread>
Information about a single thread associated with an assistant.
  • Method Summary

    Modifier and Type
    Method
    Description
    fromJson(com.azure.json.JsonReader jsonReader)
    Reads an instance of AssistantThread from the JsonReader.
    Get the createdAt property: The Unix timestamp, in seconds, representing when this object was created.
    Get the id property: The identifier, which can be referenced in API endpoints.
    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.
    Get the object property: The object type, which is always 'thread'.
    Get the toolResources property: A set of resources that are made available to the assistant's tools in this thread.
    com.azure.json.JsonWriter
    toJson(com.azure.json.JsonWriter jsonWriter)

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.azure.json.JsonSerializable

    toJson, toJson, toJsonBytes, toJsonString
  • Method Details

    • getId

      public String getId()
      Get the id property: The identifier, which can be referenced in API endpoints.
      Returns:
      the id value.
    • getObject

      public String getObject()
      Get the object property: The object type, which is always 'thread'.
      Returns:
      the object value.
    • getCreatedAt

      public OffsetDateTime getCreatedAt()
      Get the createdAt property: The Unix timestamp, in seconds, representing when this object was created.
      Returns:
      the createdAt 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.
    • toJson

      public com.azure.json.JsonWriter toJson(com.azure.json.JsonWriter jsonWriter) throws IOException
      Specified by:
      toJson in interface com.azure.json.JsonSerializable<AssistantThread>
      Throws:
      IOException
    • fromJson

      public static AssistantThread fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      Reads an instance of AssistantThread from the JsonReader.
      Parameters:
      jsonReader - The JsonReader being read.
      Returns:
      An instance of AssistantThread if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.
      Throws:
      IllegalStateException - If the deserialized JSON object was missing any required properties.
      IOException - If an error occurs while reading the AssistantThread.
    • getToolResources

      public ToolResources getToolResources()
      Get the toolResources property: A set of resources that are made available to the assistant'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.