Class ThreadRun

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

public final class ThreadRun extends Object implements com.azure.json.JsonSerializable<ThreadRun>
Data representing a single evaluation run of an assistant thread.
  • Method Summary

    Modifier and Type
    Method
    Description
    static ThreadRun
    fromJson(com.azure.json.JsonReader jsonReader)
    Reads an instance of ThreadRun from the JsonReader.
    Get the assistantId property: The ID of the assistant associated with the thread this run was performed against.
    Get the cancelledAt property: The Unix timestamp, in seconds, representing when this was cancelled.
    Get the completedAt property: The Unix timestamp, in seconds, representing when this completed.
    Get the createdAt property: The Unix timestamp, in seconds, representing when this object was created.
    Get the expiresAt property: The Unix timestamp, in seconds, representing when this item expires.
    Get the failedAt property: The Unix timestamp, in seconds, representing when this failed.
    Get the id property: The identifier, which can be referenced in API endpoints.
    Get the incompleteDetails property: Details on why the run is incomplete.
    Get the instructions property: The overridden system instructions used for this assistant thread run.
    Get the lastError property: The last error, if any, encountered by this assistant thread run.
    Get the maxCompletionTokens property: The maximum number of completion tokens specified to have been used over the course of the run.
    Get the maxPromptTokens property: The maximum number of prompt tokens specified to have been used over the course of the run.
    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 model property: The ID of the model to use.
    Get the object property: The object type, which is always 'thread.run'.
    Get the requiredAction property: The details of the action required for the assistant thread run to continue.
    Get the responseFormat property: The response format of the tool calls used in this run.
    Get the startedAt property: The Unix timestamp, in seconds, representing when this item was started.
    Get the status property: The status of the assistant thread run.
    Get the temperature property: The sampling temperature used for this run.
    Get the threadId property: The ID of the thread associated with this run.
    Get the toolChoice property: Controls whether or not and which tool is called by the model.
    Get the tools property: The overridden enabled tools used for this assistant thread run.
    Get the topP property: The nucleus sampling value used for this run.
    Get the truncationStrategy property: The strategy to use for dropping messages as the context windows moves forward.
    Get the usage property: Usage statistics related to the run.
    boolean
    Get the parallelToolCalls property: Whether to enable parallel function calling during tool use.
    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.run'.
      Returns:
      the object value.
    • getThreadId

      public String getThreadId()
      Get the threadId property: The ID of the thread associated with this run.
      Returns:
      the threadId value.
    • getAssistantId

      public String getAssistantId()
      Get the assistantId property: The ID of the assistant associated with the thread this run was performed against.
      Returns:
      the assistantId value.
    • getStatus

      public RunStatus getStatus()
      Get the status property: The status of the assistant thread run.
      Returns:
      the status value.
    • getRequiredAction

      public RequiredAction getRequiredAction()
      Get the requiredAction property: The details of the action required for the assistant thread run to continue.
      Returns:
      the requiredAction value.
    • getLastError

      public RunError getLastError()
      Get the lastError property: The last error, if any, encountered by this assistant thread run.
      Returns:
      the lastError value.
    • getModel

      public String getModel()
      Get the model property: The ID of the model to use.
      Returns:
      the model value.
    • getInstructions

      public String getInstructions()
      Get the instructions property: The overridden system instructions used for this assistant thread run.
      Returns:
      the instructions value.
    • getTools

      public List<ToolDefinition> getTools()
      Get the tools property: The overridden enabled tools used for this assistant thread run.
      Returns:
      the tools value.
    • getCreatedAt

      public OffsetDateTime getCreatedAt()
      Get the createdAt property: The Unix timestamp, in seconds, representing when this object was created.
      Returns:
      the createdAt value.
    • getExpiresAt

      public OffsetDateTime getExpiresAt()
      Get the expiresAt property: The Unix timestamp, in seconds, representing when this item expires.
      Returns:
      the expiresAt value.
    • getStartedAt

      public OffsetDateTime getStartedAt()
      Get the startedAt property: The Unix timestamp, in seconds, representing when this item was started.
      Returns:
      the startedAt value.
    • getCompletedAt

      public OffsetDateTime getCompletedAt()
      Get the completedAt property: The Unix timestamp, in seconds, representing when this completed.
      Returns:
      the completedAt value.
    • getCancelledAt

      public OffsetDateTime getCancelledAt()
      Get the cancelledAt property: The Unix timestamp, in seconds, representing when this was cancelled.
      Returns:
      the cancelledAt value.
    • getFailedAt

      public OffsetDateTime getFailedAt()
      Get the failedAt property: The Unix timestamp, in seconds, representing when this failed.
      Returns:
      the failedAt 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<ThreadRun>
      Throws:
      IOException
    • fromJson

      public static ThreadRun fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      Reads an instance of ThreadRun from the JsonReader.
      Parameters:
      jsonReader - The JsonReader being read.
      Returns:
      An instance of ThreadRun 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 ThreadRun.
    • getUsage

      public RunCompletionUsage getUsage()
      Get the usage property: Usage statistics related to the run. This value will be `null` if the run is not in a terminal state (i.e. `in_progress`, `queued`, etc.).
      Returns:
      the usage value.
    • getIncompleteDetails

      public IncompleteRunDetails getIncompleteDetails()
      Get the incompleteDetails property: Details on why the run is incomplete. Will be `null` if the run is not incomplete.
      Returns:
      the incompleteDetails value.
    • getTemperature

      public Double getTemperature()
      Get the temperature property: The sampling temperature used for this run. If not set, defaults to 1.
      Returns:
      the temperature value.
    • getTopP

      public Double getTopP()
      Get the topP property: The nucleus sampling value used for this run. If not set, defaults to 1.
      Returns:
      the topP value.
    • getMaxPromptTokens

      public Integer getMaxPromptTokens()
      Get the maxPromptTokens property: The maximum number of prompt tokens specified to have been used over the course of the run.
      Returns:
      the maxPromptTokens value.
    • getMaxCompletionTokens

      public Integer getMaxCompletionTokens()
      Get the maxCompletionTokens property: The maximum number of completion tokens specified to have been used over the course of the run.
      Returns:
      the maxCompletionTokens value.
    • getTruncationStrategy

      public TruncationObject getTruncationStrategy()
      Get the truncationStrategy property: The strategy to use for dropping messages as the context windows moves forward.
      Returns:
      the truncationStrategy value.
    • getToolChoice

      public AssistantsApiToolChoiceOption getToolChoice()
      Get the toolChoice property: Controls whether or not and which tool is called by the model.
      Returns:
      the toolChoice value.
    • getResponseFormat

      public AssistantsApiResponseFormatOption getResponseFormat()
      Get the responseFormat property: The response format of the tool calls used in this run.
      Returns:
      the responseFormat value.
    • isParallelToolCalls

      public boolean isParallelToolCalls()
      Get the parallelToolCalls property: Whether to enable parallel function calling during tool use.
      Returns:
      the parallelToolCalls value.