Class RunStepsAsyncClient

java.lang.Object
com.azure.ai.agents.persistent.RunStepsAsyncClient

public final class RunStepsAsyncClient extends Object
Initializes a new instance of the asynchronous PersistentAgentsAdministrationClient type.
  • Method Details

    • getRunStepWithResponse

      public Mono<com.azure.core.http.rest.Response<com.azure.core.util.BinaryData>> getRunStepWithResponse(String threadId, String runId, String stepId, com.azure.core.http.rest.RequestOptions requestOptions)
      Retrieves a single run step from a thread run.

      Query Parameters

      Query Parameters
      NameTypeRequiredDescription
      include[]List<String>NoA list of additional fields to include in the response. Currently the only supported value is `step_details.tool_calls[*].file_search.results[*].content` to fetch the file search result content. In the form of "," separated string.
      You can add these to a request with RequestOptions.addQueryParam(java.lang.String, java.lang.String)

      Response Body Schema

       
       {
           id: String (Required)
           object: String (Required)
           type: String(message_creation/tool_calls) (Required)
           assistant_id: String (Required)
           thread_id: String (Required)
           run_id: String (Required)
           status: String(in_progress/cancelled/failed/completed/expired) (Required)
           step_details (Required): {
               type: String(message_creation/tool_calls) (Required)
           }
           last_error (Required): {
               code: String(server_error/rate_limit_exceeded) (Required)
               message: String (Required)
           }
           created_at: long (Required)
           expired_at: Long (Required)
           completed_at: Long (Required)
           cancelled_at: Long (Required)
           failed_at: Long (Required)
           usage (Optional): {
               completion_tokens: long (Required)
               prompt_tokens: long (Required)
               total_tokens: long (Required)
           }
           metadata (Required): {
               String: String (Required)
           }
       }
       
       
      Parameters:
      threadId - Identifier of the thread.
      runId - Identifier of the run.
      stepId - Identifier of the run step.
      requestOptions - The options to configure the HTTP request before HTTP client sends it.
      Returns:
      detailed information about a single step of an agent thread run along with Response on successful completion of Mono.
      Throws:
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      com.azure.core.exception.ClientAuthenticationException - thrown if the request is rejected by server on status code 401.
      com.azure.core.exception.ResourceNotFoundException - thrown if the request is rejected by server on status code 404.
      com.azure.core.exception.ResourceModifiedException - thrown if the request is rejected by server on status code 409.
    • getRunStep

      public Mono<RunStep> getRunStep(String threadId, String runId, String stepId, List<RunAdditionalFieldList> include)
      Retrieves a single run step from a thread run.
      Parameters:
      threadId - Identifier of the thread.
      runId - Identifier of the run.
      stepId - Identifier of the run step.
      include - A list of additional fields to include in the response. Currently the only supported value is `step_details.tool_calls[*].file_search.results[*].content` to fetch the file search result content.
      Returns:
      detailed information about a single step of an agent thread run on successful completion of Mono.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      com.azure.core.exception.ClientAuthenticationException - thrown if the request is rejected by server on status code 401.
      com.azure.core.exception.ResourceNotFoundException - thrown if the request is rejected by server on status code 404.
      com.azure.core.exception.ResourceModifiedException - thrown if the request is rejected by server on status code 409.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • getRunStep

      public Mono<RunStep> getRunStep(String threadId, String runId, String stepId)
      Retrieves a single run step from a thread run.
      Parameters:
      threadId - Identifier of the thread.
      runId - Identifier of the run.
      stepId - Identifier of the run step.
      Returns:
      detailed information about a single step of an agent thread run on successful completion of Mono.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      com.azure.core.exception.ClientAuthenticationException - thrown if the request is rejected by server on status code 401.
      com.azure.core.exception.ResourceNotFoundException - thrown if the request is rejected by server on status code 404.
      com.azure.core.exception.ResourceModifiedException - thrown if the request is rejected by server on status code 409.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • listRunSteps

      public com.azure.core.http.rest.PagedFlux<RunStep> listRunSteps(String threadId, String runId, List<RunAdditionalFieldList> include, Integer limit, ListSortOrder order, String after, String before)
      Gets a list of run steps from a thread run.
      Parameters:
      threadId - Identifier of the thread.
      runId - Identifier of the run.
      include - A list of additional fields to include in the response. Currently the only supported value is `step_details.tool_calls[*].file_search.results[*].content` to fetch the file search result content.
      limit - A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
      order - Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.
      after - A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
      before - A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.
      Returns:
      a list of run steps from a thread run as paginated response with PagedFlux.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      com.azure.core.exception.ClientAuthenticationException - thrown if the request is rejected by server on status code 401.
      com.azure.core.exception.ResourceNotFoundException - thrown if the request is rejected by server on status code 404.
      com.azure.core.exception.ResourceModifiedException - thrown if the request is rejected by server on status code 409.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • listRunSteps

      public com.azure.core.http.rest.PagedFlux<RunStep> listRunSteps(String threadId, String runId)
      Gets a list of run steps from a thread run.
      Parameters:
      threadId - Identifier of the thread.
      runId - Identifier of the run.
      Returns:
      a list of run steps from a thread run as paginated response with PagedFlux.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      com.azure.core.exception.ClientAuthenticationException - thrown if the request is rejected by server on status code 401.
      com.azure.core.exception.ResourceNotFoundException - thrown if the request is rejected by server on status code 404.
      com.azure.core.exception.ResourceModifiedException - thrown if the request is rejected by server on status code 409.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • listRunSteps

      public com.azure.core.http.rest.PagedFlux<com.azure.core.util.BinaryData> listRunSteps(String threadId, String runId, com.azure.core.http.rest.RequestOptions requestOptions)
      Gets a list of run steps from a thread run.

      Query Parameters

      Query Parameters
      NameTypeRequiredDescription
      include[]List<String>NoA list of additional fields to include in the response. Currently the only supported value is `step_details.tool_calls[*].file_search.results[*].content` to fetch the file search result content. In the form of "," separated string.
      limitIntegerNoA limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
      orderStringNoSort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order. Allowed values: "asc", "desc".
      afterStringNoA cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
      beforeStringNoA cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.
      You can add these to a request with RequestOptions.addQueryParam(java.lang.String, java.lang.String)

      Response Body Schema

       
       {
           id: String (Required)
           object: String (Required)
           type: String(message_creation/tool_calls) (Required)
           assistant_id: String (Required)
           thread_id: String (Required)
           run_id: String (Required)
           status: String(in_progress/cancelled/failed/completed/expired) (Required)
           step_details (Required): {
               type: String(message_creation/tool_calls) (Required)
           }
           last_error (Required): {
               code: String(server_error/rate_limit_exceeded) (Required)
               message: String (Required)
           }
           created_at: long (Required)
           expired_at: Long (Required)
           completed_at: Long (Required)
           cancelled_at: Long (Required)
           failed_at: Long (Required)
           usage (Optional): {
               completion_tokens: long (Required)
               prompt_tokens: long (Required)
               total_tokens: long (Required)
           }
           metadata (Required): {
               String: String (Required)
           }
       }
       
       
      Parameters:
      threadId - Identifier of the thread.
      runId - Identifier of the run.
      requestOptions - The options to configure the HTTP request before HTTP client sends it.
      Returns:
      a list of run steps from a thread run as paginated response with PagedFlux.
      Throws:
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      com.azure.core.exception.ClientAuthenticationException - thrown if the request is rejected by server on status code 401.
      com.azure.core.exception.ResourceNotFoundException - thrown if the request is rejected by server on status code 404.
      com.azure.core.exception.ResourceModifiedException - thrown if the request is rejected by server on status code 409.